本文整理汇总了TypeScript中react-native.AppRegistry类的典型用法代码示例。如果您正苦于以下问题:TypeScript AppRegistry类的具体用法?TypeScript AppRegistry怎么用?TypeScript AppRegistry使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了AppRegistry类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: registerComponent
registerComponent(componentName: string, getComponentClassFunc: ComponentProvider, ReduxProvider?: any, reduxStore?: any): ComponentProvider {
const NavigationComponent = () => {
return this.ComponentWrapperClass.wrap(componentName, getComponentClassFunc, this.store, this.componentEventsObserver, ReduxProvider, reduxStore)
};
this.store.setComponentClassForName(componentName, NavigationComponent);
AppRegistry.registerComponent(componentName, NavigationComponent);
return NavigationComponent;
}
示例2: registerComponent
registerComponent(appKey: string, getComponentFunc: ComponentProvider) {
AppRegistry.registerComponent(appKey, getComponentFunc);
}
示例3: start
public async start(): Promise<void> {
let applicationState = await this.onInitialize();
let applicationComponent = await this.onGetRootComponent(applicationState);
AppRegistry.registerComponent(this._appKey, () => applicationComponent);
}
示例4:
import App from './App';
import React, { Component } from 'react';
import { AppRegistry } from 'react-native';
// register the app
AppRegistry.registerComponent('App', () => App);
AppRegistry.runApplication('App', {
initialProps: {},
rootTag: document.getElementById('react-app')
});
示例5:
import { AppRegistry } from 'react-native'
import App from '../components/App'
AppRegistry.registerComponent('PlayProject', () => App)