1.0.2 • Published 7 years ago
react-native-mylib v1.0.2
react-native-mylib
Getting started
$ npm install react-native-mylib --save
Mostly automatic installation
Better follow manual , do not link twice
`$ react-native link react-native-mylibx
Manual installation
iOS
Very important do all mandatory setup for react-native-vector-icons and react-native-file-picker
- In XCode, in the project navigator, right click
Libraries
➜Add Files to [your project's name]
- Go to
node_modules
➜react-native-mylib
and addRNMylib.xcodeproj
- In XCode, in the project navigator, select your project. Add
libRNMylib.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.reactlibrary.RNMylibPackage;
to the imports at the top of the file - Add
import com.oblador.vectoricons.VectorIconsPackage;
to the imports at the top of the file Add
import com.filepicker.FilePickerPackage
to the imports at the top of the fileAdd
new RNMylibPackage()
to the list returned by thegetPackages()
method- Add
new FilePickerPackage()
to the list returned by thegetPackages()
method - Add
new VectorIconsPackage(),
to the list returned by thegetPackages()
method
Append the following lines to
android/settings.gradle
:include ':react-native-mylib' project(':react-native-mylib').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-mylib/android') include ':react-native-file-picker' project(':react-native-file-picker').projectDir = new File(settingsDir, '../node_modules/react-native-file-picker/android') include ':react-native-vector-icons' project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android')
Insert the following lines inside the dependencies block in
android/app/build.gradle
:compile project(':react-native-vector-icons') compile project(':react-native-mylib') compile project(':react-native-file-picker')
Windows
- In Visual Studio add the
RNMylib.sln
innode_modules/react-native-mylib/windows/RNMylib.sln
folder to their solution, reference from their app. - Open up your
MainPage.cs
app
- Add
using Com.Reactlibrary.RNMylib;
to the usings at the top of the file - Add
new RNMylibPackage()
to theList<IReactPackage>
returned by thePackages
method
Usage
import FormView from 'react-native-mylib/lib/formView'
//In your components render pass url where you have your form json
<FormView url = {'url to your json of form'} />