DefaultReactNativeHost

A utility class that allows you to simplify the setup of a ReactNativeHost for new apps in Open Source.

Specifically, for apps that are using the New Architecture, this Default class takes care of providing the default TurboModuleManagerDelegateBuilder and the default JSIModulePackage, provided the name of the dynamic library to load.

Functions

Link copied to clipboard
open override fun clear()

Destroy the current instance and invalidate the internal ReactInstanceManager, reclaiming its resources and preventing it from being reused.

Link copied to clipboard

Returns whether view managers should be created lazily. See for details.

Link copied to clipboard

Get the current ReactInstanceManager instance, or create one.

Link copied to clipboard

Returns whether or not to treat it as normal if Activity is null.

Link copied to clipboard

Return the SurfaceDelegateFactory used by NativeModules to get access to a to interact with a surface. By default in the mobile platform the it returns is null, and the NativeModule needs to implement its own to decide how it would interact with its own container surface.

Link copied to clipboard

Returns whether dev mode should be enabled. This enables e.g. the dev menu.

Link copied to clipboard
open fun hasInstance(): Boolean

Get whether this holder contains a ReactInstanceManager instance, or not. I.e. if getReactInstanceManager has been called at least once since this object was created or clear was called.