react-native-library-sample

v0.0.2
>A react-native library sample for test. Also see the react-native project [react-native-master](https://github.com/hbxeagle/react-native-master).
react-native react-native-create-library react native module

react-native-library-sample

A react-native library sample for test. Also see the react-native project react-native-master.

Getting started

$ npm install react-native-library-sample --save

Mostly automatic installation

$ react-native link react-native-library-sample

Manual installation

iOS

  1. In XCode, in the project navigator, right click LibrariesAdd Files to [your project's name]
  2. Go to node_modulesreact-native-library-sample and add RNLibrarySample.xcodeproj
  3. In XCode, in the project navigator, select your project. Add libRNLibrarySample.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.RNLibrarySamplePackage; to the imports at the top of the file
  • Add new RNLibrarySamplePackage() to the list returned by the getPackages() method
  1. Append the following lines to android/settings.gradle:
    include ':react-native-library-sample'
    project(':react-native-library-sample').projectDir = new File(rootProject.projectDir, 	'../node_modules/react-native-library-sample/android')
    
  2. Insert the following lines inside the dependencies block in android/app/build.gradle:
    compile project(':react-native-library-sample')
    

Usage

import RNLibrarySample from 'react-native-library-sample';

// TODO: What to do with the module?
RNLibrarySample;
npm i react-native-library-sample

Metadata

  • MIT
  • Whatever
  • hbxeagle
  • released 2/28/2018

Downloads

Maintainers