react-native
react-native copied to clipboard
Configure react native android jscodelocation
How am I suppose to configure jscodelocation for react native android in real product? Is it doable?
During development you can set a key in SharedPreferences called "debug_http_host" to configure the host of the packager server.
SharedPreferences preferences =
PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
preferences.edit().putString("debug_http_host", "localhost").apply();
Currently you can curl/wget your JS from the packager, include it with your APK, and tell the ReactInstanceManager to load the JS from an asset (see setBundleAssetName). That is the extent to which you can customize things for now. See https://github.com/facebook/react-native/issues/2703#issuecomment-140288212 for specifics.
Thanks, will try.