get Default React Host
Util function to create a default ReactHost to be used in your application. This method is used by the New App template.
Parameters
the list of ReactPackages to use for creating the ReactHost
the path to your app's main module on Metro. Usually index
or index.<platform>
the path to the JS bundle relative to the assets directory. Will be composed in a asset://...
URL
the path to the JS bundle on the filesystem. Will be composed in a file://...
URL
the JS engine to use for executing ReactHost, default to Hermes.
whether to enable dev support, default to ReactBuildConfig.DEBUG.
a list of cxxreactpackage providers (to register c++ turbo modules)
TODO(T186951312): Should this be @UnstableReactNativeAPI?
Util function to create a default ReactHost to be used in your application. This method is used by the New App template.
Parameters
the list of ReactPackages to use for creating the ReactHost
the path to your app's main module on Metro. Usually index
or index.<platform>
the path to the JS bundle relative to the assets directory. Will be composed in a asset://...
URL
the path to the JS bundle on the filesystem. Will be composed in a file://...
URL
the JS engine to use for executing ReactHost, default to Hermes.
whether to enable dev support, default to ReactBuildConfig.DEBUG.
a list of cxxreactpackage providers (to register c++ turbo modules)
Callback that can be used by React Native host applications to react to exceptions thrown by the internals of React Native.
that can be used for installing bindings.
TODO(T186951312): Should this be @UnstableReactNativeAPI?
Util function to create a default ReactHost to be used in your application. This method is used by the New App template.
This method takes in input a ReactNativeHost (bridge-mode) and uses its configuration to create an equivalent ReactHost (bridgeless-mode).
Parameters
the ReactNativeHost to use for creating the ReactHost
TODO(T186951312): Should this be @UnstableReactNativeAPI? It's not, to maintain consistency with above getDefaultReactHost.
Deprecated
Use `getDefaultReactHost` with `jsRuntimeFactory` instead
Replace with
fun getDefaultReactHost(
context: Context,
packageList: List<ReactPackage>,
jsMainModulePath: String,
jsBundleAssetPath: String,
jsBundleFilePath: String?,
jsRuntimeFactory: JSRuntimeFactory?,
useDevSupport: Boolean,
cxxReactPackageProviders: List<(ReactContext) -> CxxReactPackage>,
exceptionHandler: (Exception) -> Unit,
bindingsInstaller: BindingsInstaller?,
): ReactHost
Util function to create a default ReactHost to be used in your application. This method is used by the New App template.
Parameters
the list of ReactPackages to use for creating the ReactHost
the path to your app's main module on Metro. Usually index
or index.<platform>
the path to the JS bundle relative to the assets directory. Will be composed in a asset://...
URL
the path to the JS bundle on the filesystem. Will be composed in a file://...
URL
whether to use Hermes as the JS engine, default to true.
whether to enable dev support, default to ReactBuildConfig.DEBUG.
a list of cxxreactpackage providers (to register c++ turbo modules)
Callback that can be used by React Native host applications to react to exceptions thrown by the internals of React Native.
that can be used for installing bindings.
Deprecated
Use `getDefaultReactHost` with `jsRuntimeFactory` instead
Replace with
fun getDefaultReactHost(
context: Context,
packageList: List<ReactPackage>,
jsMainModulePath: String,
jsBundleAssetPath: String,
jsBundleFilePath: String?,
jsRuntimeFactory: JSRuntimeFactory?,
useDevSupport: Boolean,
cxxReactPackageProviders: List<(ReactContext) -> CxxReactPackage>,
): ReactHost
Util function to create a default ReactHost to be used in your application. This method is used by the New App template.
Parameters
the list of ReactPackages to use for creating the ReactHost
the path to your app's main module on Metro. Usually index
or index.<platform>
the path to the JS bundle relative to the assets directory. Will be composed in a asset://...
URL
the path to the JS bundle on the filesystem. Will be composed in a file://...
URL
whether to use Hermes as the JS engine, default to true.
whether to enable dev support, default to ReactBuildConfig.DEBUG.
a list of cxxreactpackage providers (to register c++ turbo modules)