Skip to content

Commit 20808b5

Browse files
mdvaccafacebook-github-bot
authored andcommitted
Document ReactHostDelegate (#37562)
Summary: Pull Request resolved: #37562 Add documentation for ReactHostDelegate changelog: [internal] internal Reviewed By: cortinico Differential Revision: D45717674 fbshipit-source-id: e0d6d70edf4f4cf70b53807732b35f5fda917fc3
1 parent cd71a71 commit 20808b5

File tree

1 file changed

+28
-1
lines changed

1 file changed

+28
-1
lines changed

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridgeless/ReactHostDelegate.kt

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,24 +16,51 @@ import com.facebook.react.common.annotations.UnstableReactNativeAPI
1616
import com.facebook.react.fabric.ReactNativeConfig
1717
import com.facebook.react.turbomodule.core.TurboModuleManagerDelegate
1818

19-
/** TODO: add javadoc for class and methods */
19+
/**
20+
* [ReactHostDelegate] is an interface that defines parameters required to initialize React Native.
21+
* This interface works in combination with [ReactHost]
22+
*/
2023
@ThreadSafe
2124
@UnstableReactNativeAPI
2225
interface ReactHostDelegate {
26+
/**
27+
* Path to your app's main module on Metro. This is used when reloading JS during development. All
28+
* paths are relative to the root folder the packager is serving files from. Examples:
29+
* `index.android` or `subdirectory/index.android`
30+
*/
2331
val jSMainModulePath: String
2432

33+
/**
34+
* Object that holds a native C++ references that allow host applications to install C++ objects
35+
* into jsi::Runtime during the initialization of React Native
36+
*/
2537
val bindingsInstaller: BindingsInstaller?
2638

39+
/** list of [ReactPackage] to expose Native Modules and View Components to JS */
2740
val reactPackages: List<ReactPackage>
2841

42+
/** Object that holds a native reference to the javascript engine */
2943
val jSEngineInstance: JSEngineInstance
3044

45+
/**
46+
* Bundle loader to use when setting up JS environment. <p>Example:
47+
* [JSBundleLoader.createFileLoader(application, bundleFile)]
48+
*/
3149
val jSBundleLoader: JSBundleLoader
3250

51+
/** TODO: combine getTurboModuleManagerDelegate inside [ReactPackage] */
3352
fun getTurboModuleManagerDelegate(context: ReactApplicationContext): TurboModuleManagerDelegate
3453

54+
/**
55+
* Callback that can be used by React Native host applications to react to exceptions thrown by
56+
* the internals of React Native.
57+
*/
3558
fun handleInstanceException(error: Exception)
3659

60+
/**
61+
* ReactNative Configuration that allows to customize the behavior of key/value pairs used by the
62+
* framework to enable/disable experimental capabilities
63+
*/
3764
fun getReactNativeConfig(context: ReactContext): ReactNativeConfig
3865

3966
@UnstableReactNativeAPI

0 commit comments

Comments
 (0)