as

Settings
Sign out
Notifications
Alexa
亚马逊应用商店
Ring
AWS
文档
Support
Contact Us
My Cases
新手入门
设计和开发
应用发布
参考
支持
原生
Skip to main content
AppRegistry is the JS entry point to running all React Native apps. App root components should register themselves with AppRegistry.registerComponent, then the native system can load the bundle for the app and then actually run the app when it’s ready by invoking AppRegistry.runApplication.
To “stop” an application when a view should be destroyed, call AppRegistry.unmountApplicationComponentAtRootTag with the tag that was passed into runApplication. These should always be used as a pair. AppRegistry should be required early in the require sequence to make sure the JS execution environment is setup before other modules are required.

Reference

Methods

getAppKeys()

Returns an array of strings.

getRegistry()

Returns a Registry object.

getRunnable()

Returns a Runnable object. Parameters:

getSectionKeys()

Returns an array of strings.

getSections()

Returns a Runnables object.

registerComponent()

Parameters:

registerConfig()

Parameters:

registerRunnable()

Parameters:

registerSection()

Parameters:

runApplication()

Loads the JavaScript bundle and runs the app. Parameters:

setComponentProviderInstrumentationHook()

Parameters: A valid hook function accepts the following as arguments: The function must also return a React Component.

setWrapperComponentProvider()

Parameters:

unmountApplicationComponentAtRootTag()

Stops an application when a view should be destroyed. Parameters:

Type definitions

AppConfig

Application configuration for the registerConfig method. Properties: Note: Every config is expected to set either component or run function.

Registry

Properties:

Runnable

Properties:

Runnables

An object with key of appKey and value of type of Runnable.
最后修改于 2026年11月12日