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 using a custom `ReactDelegateWrapper`. |
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 |
167
166
168
167
Returns: `FrameLayout` - A view containing the React Native component.
169
168
@@ -172,13 +171,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 `ReactDelegateWrapper`. |
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 |
146
145
147
146
Returns: `FrameLayout` - A view containing the React Native component.
148
147
@@ -151,18 +150,28 @@ Returns: `FrameLayout` - A view containing the React Native component.
151
150
```kotlin
152
151
// In a Fragment or Activity
153
152
val reactView =ReactNativeBrownfield.shared.createView(
154
-
context,
155
153
activity,
156
154
"ReactNative"
157
155
)
158
156
container.addView(reactView)
159
157
```
160
158
159
+
```kotlin
160
+
// With initial properties
161
+
val props =Bundle().apply { putInt("score", 12) }
162
+
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).
Copy file name to clipboardExpand all lines: docs/docs/docs/guides/troubleshooting.mdx
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,9 +4,9 @@ This section provides a troubleshooting guide for common issues encountered when
4
4
5
5
## [Android]`Error: duplicate resources` during `:app:mergeReleaseAssets`
6
6
7
-
An error like `Error: duplicate resources` during the `:app:mergeReleaseAssets` phase may occur if you have upgraded your React Native version from a version less than `0.82.0`, to a version greater than or equal to (>=) `0.82.0`.
7
+
An error like `Error: duplicate resources` during the `:app:mergeReleaseAssets` phase may occur if you have upgraded your React Native version from a version less than `0.82.0`, to a version greater than or equal to (>=) `0.82.0`.
8
8
9
-
This is because RN 0.82.0 changed the path to which the JS bundle is written to from `build/generated/assets/createBundleReleaseJsAndAssets/` to `build/generated/assets/react/release/`, and analogously changed the path for `res/createBundleReleaseJsAndAssets/`.
9
+
This is because RN 0.82.0 changed the path to which the JS bundle is written to from `build/generated/assets/createBundleReleaseJsAndAssets/` to `build/generated/assets/react/release/`, and analogously changed the path for `res/createBundleReleaseJsAndAssets/`.
10
10
11
11
The brownfield Gradle plugin adds both directories to the source sets, potentially causing a conflict of artifacts. To fix this, just once clean your build directory (precisely, the `app/build/` directory) and rebuild the project. All subsequent builds should work fine.
0 commit comments