1.0.2 • Published 7 years ago

react-native-mylib v1.0.2

Weekly downloads
13
License
-
Repository
-
Last release
7 years ago

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

  1. In XCode, in the project navigator, right click LibrariesAdd Files to [your project's name]
  2. Go to node_modulesreact-native-mylib and add RNMylib.xcodeproj
  3. In XCode, in the project navigator, select your project. Add libRNMylib.a to your project's Build PhasesLink Binary With Libraries
  4. Run your project (Cmd+R)<

Android

  1. 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 file

  • Add new RNMylibPackage() to the list returned by the getPackages() method

  • Add new FilePickerPackage() to the list returned by the getPackages() method
  • Add new VectorIconsPackage(), to the list returned by the getPackages() method
  1. 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')  
  2. 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

Read it! :D

  1. In Visual Studio add the RNMylib.sln in node_modules/react-native-mylib/windows/RNMylib.sln folder to their solution, reference from their app.
  2. Open up your MainPage.cs app
  • Add using Com.Reactlibrary.RNMylib; to the usings at the top of the file
  • Add new RNMylibPackage() to the List<IReactPackage> returned by the Packages 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'} />