本文整理匯總了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)