You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Creates a React Native view with a given module name. It automatically uses an instance of React Native created in `initialize` method. This is useful when embedding React Native views directly in your native layouts.
|activity| No|`FragmentActivity`| Activity hosting the view, used for lifecycle management. Required for proper lifecycle; may be null only when passing a custom `reactDelegate`.|
164
+
|moduleName| Yes |`String`| Name of React Native component registered to `AppRegistry`. |
165
+
|launchOptions | No|`Bundle`| Initial properties to be passed to React Native component. |
166
+
|reactDelegate| No |`ReactDelegateWrapper`| Optional custom delegate. If passed, the `activity` argument is ignored. |
167
167
168
168
Returns: `FrameLayout` - A view containing the React Native component.
169
169
@@ -172,13 +172,25 @@ Returns: `FrameLayout` - A view containing the React Native component.
Send a JSON string to the React Native JS layer. The message is delivered as a `brownfieldMessage` DeviceEventEmitter event and can be received using `ReactNativeBrownfield.onMessage()` on the JS side.
Creates a React Native view with a given module name. It automatically uses an instance of React Native created in `initialize` method. This is useful when embedding React Native views directly in your native layouts or Jetpack Compose UI.
|activity| No|`FragmentActivity`| Activity hosting the view, used for lifecycle management. Required for proper lifecycle; may be null only when using a custom `reactDelegate`.|
143
+
|moduleName| Yes |`String`| Name of React Native component registered to `AppRegistry`. |
144
+
|launchOptions | No|`Bundle`| Initial properties to be passed to React Native component. |
145
+
|reactDelegate| No |`ReactDelegateWrapper`| Optional custom delegate. If passed, the `activity` argument is ignored. |
146
146
147
147
Returns: `FrameLayout` - A view containing the React Native component.
148
148
@@ -151,18 +151,28 @@ Returns: `FrameLayout` - A view containing the React Native component.
151
151
```kotlin
152
152
// In a Fragment or Activity
153
153
val reactView =ReactNativeBrownfield.shared.createView(
154
-
context,
155
154
activity,
156
155
"ReactNative"
157
156
)
158
157
container.addView(reactView)
159
158
```
160
159
160
+
```kotlin
161
+
// With initial properties
162
+
val props =Bundle().apply { putInt("score", 12) }
163
+
val reactView =ReactNativeBrownfield.shared.createView(
Mirrors the host runtime app delegate API. Call this from your `AppDelegate` if you need to forward launch options to the brownfield runtime (e.g. when using Expo).
Mirrors the host runtime app delegate API. Call this from your `AppDelegate` if you need to forward `application(_:didFinishLaunchingWithOptions:)` to the brownfield runtime (e.g. when using Expo).
0 commit comments