React Native-13.React Native 常用API及实践 AppRegistry
发布时间:2020-12-15 04:39:33 所属栏目:百科 来源:网络整理
导读:AppRegistry简介 AppRegistry是RN应用的入口函数。 程序入口组件使用 AppRegistry.registerComponent 来注册。当注册完应用程序组件后,Native系统(OC)就会加载jsbundle文件并触发 AppRegistry.runApplication 运行应用。AppRegistry有以下方法: register
AppRegistry简介AppRegistry是RN应用的入口函数。 程序入口组件使用
实例在前边的文章中,我们都使用了 AppRegistry.registerComponent('wxsPrj',() => wxsPrj);
我们在XCode启动RN程序的时候会在log栏中看到这样的输出: 2016-02-24 12:05:36.838 [trace][tid:com.facebook.React.JavaScript] Running application "wxsPrj" with appParams: {"rootTag":1,"initialProps":{}}. __DEV__ === true,development-level warning are ON,performance optimizations are OFF
这个日志信息是由 我们还可以使用 AppRegistry.registerRunnable('wxs',function(){
console.log('was');
})
alert(AppRegistry.getAppKeys());
(编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |