Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/date/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
React native 可以远程加载js文件吗?_React Native - Fatal编程技术网

React native 可以远程加载js文件吗?

React native 可以远程加载js文件吗?,react-native,React Native,在Facebook的官方例子中,它说 NSURL *jsCodeLocation; /** * 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

在Facebook的官方例子中,它说

NSURL *jsCodeLocation;

/**
* 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 this by typing `ifconfig` into the terminal and selecting the
* `inet` value under `en0:`) and make sure your computer and iOS device are
* on the same Wi-Fi network.
*/

jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/index.ios.bundle"];
我的问题是我可以远程使用js文件吗,例如“”


我收到错误
在此服务器上找不到请求的URL/index.ios.bundle。

是的,react native可以远程加载js文件


您应该将捆绑的js文件上传到服务器,并更改
jsCodeLocation
变量。

苹果会批准该应用程序吗?我不确定他们是否愿意that@Jonathan我的应用程序使用react native刚刚通过苹果公司的审查。捆绑js是否可以远程获取?如果他们允许的话,那就太酷了。你能帮帮忙吗?您的服务器如何为
React Native
文件提供服务?我的意思是把文件打包。。