DefaultReactHostDelegate

class DefaultReactHostDelegate(val jsMainModulePath: String, val jsBundleLoader: JSBundleLoader, val reactPackages: List<ReactPackage> = emptyList(), val jsRuntimeFactory: JSRuntimeFactory = HermesInstance(), val bindingsInstaller: BindingsInstaller? = null, exceptionHandler: (Exception) -> Unit = { throw it }, val turboModuleManagerDelegateBuilder: ReactPackageTurboModuleManagerDelegate.Builder) : ReactHostDelegate

A utility class that allows you to simplify the initialization of React Native by setting up a ReactHostDelegate that uses recommended dependencies.

Parameters

jsMainModulePath

Path to your app's main module on Metro. This is used when reloading JS during development. All paths are relative to the root folder the packager is serving files from. Examples: index.android or subdirectory/index.android

jsBundleLoader

Bundle loader to use when setting up JS environment.

Example: JSBundleLoader.createFileLoader(application, bundleFile)

reactPackages

list of reactPackages to expose Native Modules and View Components to JS

jsRuntimeFactory

Object that holds a native reference to the JS Runtime factory

bindingsInstaller

Object that holds a native C++ references that allow host applications to install C++ objects into jsi::Runtime during the initialization of React Native

exceptionHandler

Callback that can be used by React Native host applications to react to exceptions thrown by the internals of React Native.

Constructors

Link copied to clipboard
constructor(jsMainModulePath: String, jsBundleLoader: JSBundleLoader, reactPackages: List<ReactPackage> = emptyList(), jsRuntimeFactory: JSRuntimeFactory = HermesInstance(), bindingsInstaller: BindingsInstaller? = null, exceptionHandler: (Exception) -> Unit = { throw it }, turboModuleManagerDelegateBuilder: ReactPackageTurboModuleManagerDelegate.Builder)

Properties

Link copied to clipboard
open override val bindingsInstaller: BindingsInstaller? = null
Link copied to clipboard
open override val jsBundleLoader: JSBundleLoader
Link copied to clipboard
open override val jsMainModulePath: String
Link copied to clipboard
Link copied to clipboard
open override val reactPackages: List<ReactPackage>
Link copied to clipboard

TODO: combine getTurboModuleManagerDelegate inside ReactPackage

Functions

Link copied to clipboard
open override fun handleInstanceException(error: Exception)

Callback that can be used by React Native host applications to react to exceptions thrown by the internals of React Native.