React native应用程序注册表appRegistry
来源:互联网 发布:mac优酷弹幕怎么设置 编辑:程序博客网 时间:2024/06/07 11:57
AppRegistry
是运行所有 React Native 应用程序的 JS 入口点。应用程序跟组件需要通过 AppRegistry.registerComponent
来注册它们自身,然后本地系统就可以加载应用程序的包,再然后当 AppRegistry.runApplication
准备就绪后就可以真正的运行该应用程序了。
AppRegistry
在 require
序列里是 required
,确保在其他模块被需求之前 JS 执行环境已经被 required
。
方法
static **registerConfig**(config: Array<AppConfig>) 静态方法用来注册配置信息static **registerComponent**(appKey: string, getComponentFunc: Function) 注册组件static **registerRunnable**(appKey: string, func: Function) 注册线程static **runApplication**(appKey: string, appParameters: any)
方法
static **registerConfig**(config: Array<AppConfig>) 静态方法用来注册配置信息static **registerComponent**(appKey: string, getComponentFunc: Function) 注册组件static **registerRunnable**(appKey: string, func: Function) 注册线程static **runApplication**(appKey: string, appParameters: any)
我们在写react native的js的时候,在最后总会加上一段代码:
代码的意思:定义了一个名为ReactDemo的新的
组件(Component)
,并且使用了名为AppRegistry
的内置模块进行了“注册”操作。在编写React Native应用时,肯定会写出很多新的组件。而一个App的最终界面,其实也就是各式各样的组件的组合。这和android和ios的思路不谋而合,其实React Native的组件也很丰富。appRegister模块是用来告诉rn哪一个组件作为整个应用的根容器。
使用appRegister注册自己,原生系统就可以通过加载运行bundle文件包,最后通过appRegister.runapplication来运行应用。
阅读全文
0 0
- React native应用程序注册表appRegistry
- React Native之AppRegistry模块
- React Native——AppRegistry
- React Native 的常用组件和API-AppRegistry
- 运行React Native项目报:error calling appregistry.run application
- React Native-13.React Native 常用API及实践 AppRegistry
- React Native在index.android.js中AppRegistry.registerComponent注册多个
- React Native学习笔记(二)--index.android.js 内容和ReactNative组件(<Text>、AppRegistry、View、StyleSheet)及Component
- React Native与现有的应用程序集成
- 在windows开发react-native android应用程序出现的错误
- react native
- React Native
- React Native
- React- Native
- react-native
- React Native
- React Native
- react native
- 2017/12/14
- 搭建高可用mongodb集群(一)——配置mongodb
- 梯度算法之批量梯度下降,随机梯度下降和小批量梯度下降
- P2P穿透(ENet丢包重传)
- 蓝桥杯 ADV-171 算法提高 身份证号码升级 (java)
- React native应用程序注册表appRegistry
- 免费UNITY资源的超级列表
- wiki confluence 安装
- 第8周 【项目3-顺序串算法】
- 跨平台交叉编译FFmpeg库(Android、IOS、S2L)
- Spring IOC <context:annotation-config>与<context:component-scan/>
- count(*),count(1),count(id),count(rowid)的效率
- SpringBoot系列<六>Logback日志配置
- 171214 L0 vs L1 vs L2 vs Lp