Skip to content

yoonghan/ReactNative-Modular

Repository files navigation

React native as a modular approach

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.

Concept:

Imagine that you do:

  1. Open the app.
  2. Download the compiled javascript, this javascript is React native script.
  3. Open a seperate Application page to render the App.
  4. Modify the layout/javascript and reload the App.
  5. The App now shows the latest code.

Installation

  1. Install nodeJS.
brew install node
brew install watchman #For macOS
  1. Run
npm install
  1. Install react-native
npm install -g react-native-cli
  1. Connect to a phone or startup the emulator. Execute on the phone by running
react-native run-android

Manual changes

  1. Change the download file path in MainActivity.java and modify the variable GIT_LOCATION.
  2. 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 
  1. Then upload index.android.bundle code into a server according to the GIT_LOCATION.

About

Load dynamic or 3rd party JS script and execute as React Code

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published