1.0.9 • Published 5 years ago
react-native-sven v1.0.9
react-native-sven
Getting started
$ npm install react-native-sven --save
Mostly automatic installation
$ react-native link react-native-sven
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-svenand addRNReactNativeSven.xcodeproj
- In XCode, in the project navigator, select your project. Add libRNReactNativeSven.ato 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.reactlibrary.RNReactNativeSvenPackage;to the imports at the top of the file
- Add new RNReactNativeSvenPackage()to the list returned by thegetPackages()method
- Append the following lines to android/settings.gradle:include ':react-native-sven' project(':react-native-sven').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-sven/android')
- Insert the following lines inside the dependencies block in android/app/build.gradle:compile project(':react-native-sven')
Windows
- In Visual Studio add the RNReactNativeSven.slninnode_modules/react-native-sven/windows/RNReactNativeSven.slnfolder to their solution, reference from their app.
- Open up your MainPage.csapp
- Add using React.Native.Sven.RNReactNativeSven;to the usings at the top of the file
- Add new RNReactNativeSvenPackage()to theList<IReactPackage>returned by thePackagesmethod
Usage
import RNReactNativeSven from 'react-native-sven';
// TODO: What to do with the module?
RNReactNativeSven;