Creating 3rd party module for react native to load. This concept is based on https://facebook.github.io/react-native/docs/integration-with-existing-apps.html. JS script are downloaded externally and then loaded as react native rendered into the screen.
Imagine that you do:
- Open the app.
- Download the compiled javascript, this javascript is React native script.
- Open a seperate Application page to render the App.
- Modify the layout/javascript and reload the App.
- The App now shows the latest code.
- Install nodeJS.
brew install node
brew install watchman #For macOS
- Run
npm install
- Install react-native
npm install -g react-native-cli
- Connect to a phone or startup the emulator. Execute on the phone by running
react-native run-android
- Change the download file path in MainActivity.java and modify the variable GIT_LOCATION.
- If there are interface changes for the React part, run:
react-native bundle --platform android --dev false --entry-file index.js --bundle-output index.android.bundle
- Then upload index.android.bundle code into a server according to the GIT_LOCATION.