/** * Loading JavaScript code-uncomment The one you want. * OPTION 1 * Load from Development server. Start the server from the repository root: * * $ NPM -Start * * to-run on device, change ' localhost ' to the IP address of your computer * (You can get it by typing ' ifconfig "into the terminal and selecting the * ' inet ' Value under ' En0: ') and make sure your computer and IOS device is * on the same Wi-Fi network. */ jscodelocation = [Nsurl urlwithstring:@ "Http://localhost:8081/index.ios.bundle?platform=ios&dev=true" ]; /** * OPTION 2 * Load from pre-bundled file on disk. To re-generate the static bundle * from the root of your project directory, run * * $ react-native Bundle- -minify * * See http://facebook.github.io/react-native/docs/runningondevice.html */// Jscodelocation = [[NSBundle Mainbundle] urlforresource:@ "main" withextension:@ "Jsbundle"];
The translation is:
(1) Run directly through the local NPM start, need to compile, the first run will be relatively slow
(2) Get the Jsbundle file and run it directly. Release mode, can also be updated via JS online.
React native JS file from where to get