1.0.0 • Published 6 years ago
cxa-react-native-module v1.0.0
react-native-cxa
Getting started
$ npm install react-native-cxa --save
Mostly automatic installation
$ react-native link react-native-cxa
Manual installation
iOS
- In XCode, in the project navigator, right click
Libraries
➜Add Files to [your project's name]
- Go to
node_modules
➜react-native-cxa
and addRNCxa.xcodeproj
- In XCode, in the project navigator, select your project. Add
libRNCxa.a
to your project'sBuild Phases
➜Link Binary With Libraries
- Run your project (
Cmd+R
)<
Android
- Open up
android/app/src/main/java/[...]/MainActivity.java
- Add
import com.tl.uic.RNCxaPackage;
to the imports at the top of the file - Add
new RNCxaPackage()
to the list returned by thegetPackages()
method
- Append the following lines to
android/settings.gradle
:include ':react-native-cxa' project(':react-native-cxa').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-cxa/android')
- Insert the following lines inside the dependencies block in
android/app/build.gradle
:compile project(':react-native-cxa')
Usage
import RNCxa from 'react-native-cxa';
// TODO: What to do with the module?
RNCxa;
Sample Code with integrations
1.- NativeBase-KitchenSink taken from https://github.com/GeekyAnts/NativeBase-KitchenSink
Demo
iOS | Android |
---|---|
Installation
- Install packages
cd NativeBase-KitchenSink
yarn
react-native link react-native-vector-icons
- Run on iOS
- Opt #1:
- Open the project in Xcode from
ios/NativeBase-KitchenSink.xcodeproj
- Click
run
button to simulate
- Open the project in Xcode from
- Opt #2:
- Run
react-native run-ios
in your terminal
- Run
- Opt #1:
- Run on Android
- Make sure you have an
Android emulator
installed and running - Run
react-native run-android
in your terminal
- Make sure you have an
1.0.0
6 years ago