Getting started to write React Native bridge module for Android.
cd Example
npm install
react-native run-android
-
Create a new React Native project:
react-native init NewProject
-
Add the local module to dependencies in package.json:
"dependencies": { "react": "16.0.0-alpha.6", "react-native": "0.43.3", "react-native-helloworld":"file:../" },
-
Link dependencies:
react-native link
-
Use the module in index.android.js:
import MyModule from 'react-native-helloworld'; const onButtonPress = () => { MyModule.alert('Hello World'); };
React Native Bridging Modules for Android from Scratch on Windows