我们要去的地方http://localhost:8081/在React Native App for Android中



我正在尝试使用React Native创建一个android应用程序。我是React native的新手。我的问题是,我们可以从以下位置加载index.js文件吗https://domain_name.com/appname/index.或者我们在哪里为react native设置http://localhost:8081?

对于开发,您可以通过向命令react-native start提供--port参数来自定义端口号,如下所述。

理论上,您可以使用ngrok等工具将打包服务器暴露在互联网上,并相应地通过开发人员调试菜单配置bundler。不过我还没有亲自尝试过。

对于生产,您可以通过expo更新或react本地代码推送,使最新的js捆绑包可以通过互联网访问。

最新更新