Can react-native load a js file remotely? -
in facebook's official example, says
nsurl *jscodelocation; /** * loading javascript code - uncomment 1 want. * * option 1 * load development server. start server repository root: * * $ npm start * * run on device, change `localhost` ip address of computer * (you can typing `ifconfig` terminal , selecting * `inet` value under `en0:`) , make sure computer , ios device * on same wi-fi network. */ jscodelocation = [nsurl urlwithstring:@"http://localhost:8081/index.ios.bundle"];
my question can use js file remotely, e.g., "http://www.example.com/index.ios.bundle"?
i got error the requested url /index.ios.bundle not found on server.
yes, react-native can load js file remotely.
you should upload bundled js file server , change jscodelocation
variable.
Comments
Post a Comment