Android代码-React-Native-Remote-Update

时间:2022-08-25 23:16:16
【文件属性】:

文件名称:Android代码-React-Native-Remote-Update

文件大小:32.94MB

文件格式:ZIP

更新时间:2022-08-25 23:16:16

Android代码

使用React-Native实现app热部署的一次实践 效果 原理 demo中执行热部署的实现流程如下: 最新版本的React Native版本中,加入了如下支持: /** * Path to the JS bundle file to be loaded from the file system. * * Example: {@code "assets://index.android.js" or "/sdcard/main.jsbundle} */ public Builder setJSBundleFile(String jsBundleFile) { mJSBundleFile = jsBundleFile; return this; } 这是热部署的突破口,由于React Native加载的js文件都打包在bundle中,通过这个方法,可以设置app加载的bundle来源。若检测到远端存在更新的bundle文件,下载好后重新加载即可。 为了在运行中重新加载bundle文件,查看Reac


网友评论