Skip to content

Commit cd71a71

Browse files
mdvaccafacebook-github-bot
authored andcommitted
Add documentation into DefaultReactHostDelegate (#37561)
Summary: Pull Request resolved: #37561 Add documentation into DefaultReactHostDelegate changelog: [internal] internal Reviewed By: cortinico Differential Revision: D45717456 fbshipit-source-id: b9485db26fa8a6c0e9a2267915e3269276e8138d
1 parent 5b78608 commit cd71a71

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/defaults/DefaultBindingsInstaller.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,12 @@
77

88
package com.facebook.react.defaults
99

10+
import com.facebook.jni.annotations.DoNotStrip
1011
import com.facebook.react.bridgeless.BindingsInstaller
1112
import com.facebook.react.common.annotations.UnstableReactNativeAPI
1213

13-
@UnstableReactNativeAPI class DefaultBindingsInstaller : BindingsInstaller(null) {}
14+
/**
15+
* A utility class that provides users a default [BindingsInstaller] class that's used to initialize
16+
* [ReactHostDelegate]
17+
*/
18+
@DoNotStrip @UnstableReactNativeAPI class DefaultBindingsInstaller : BindingsInstaller(null) {}

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/defaults/DefaultReactHostDelegate.kt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
package com.facebook.react.defaults
99

10+
import com.facebook.jni.annotations.DoNotStrip
1011
import com.facebook.react.ReactPackage
1112
import com.facebook.react.bridge.JSBundleLoader
1213
import com.facebook.react.bridge.ReactApplicationContext
@@ -19,6 +20,25 @@ import com.facebook.react.common.annotations.UnstableReactNativeAPI
1920
import com.facebook.react.fabric.ReactNativeConfig
2021
import com.facebook.react.turbomodule.core.TurboModuleManagerDelegate
2122

23+
/**
24+
* A utility class that allows you to simplify the initialization of React Native by setting up a
25+
* [ReactHostDelegate] that uses recommended dependencies.
26+
*
27+
* @param jSMainModulePath Path to your app's main module on Metro. This is used when reloading JS
28+
* during development. All paths are relative to the root folder the packager is serving files
29+
* from. Examples: `index.android` or `subdirectory/index.android`
30+
* @param jSBundleLoader Bundle loader to use when setting up JS environment. <p>Example:
31+
* [JSBundleLoader.createFileLoader(application, bundleFile)]
32+
* @param reactPackages list of reactPackages to expose Native Modules and View Components to JS
33+
* @param jSEngineInstance Object that holds a native reference to the javascript engine
34+
* @param bindingsInstaller Object that holds a native C++ references that allow host applications
35+
* to install C++ objects into jsi::Runtime during the initialization of React Native
36+
* @param reactNativeConfig ReactNative Configuration that allows to customize the behavior of
37+
* key/value pairs used by the framework to enable/disable experimental capabilities
38+
* @param exceptionHandler Callback that can be used by React Native host applications to react to
39+
* exceptions thrown by the internals of React Native.
40+
*/
41+
@DoNotStrip
2242
@UnstableReactNativeAPI
2343
class DefaultReactHostDelegate(
2444
override val jSMainModulePath: String,

0 commit comments

Comments
 (0)