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
The React Native Brownfield library is intended to be installed in a React Native app that is later consumed as a framework artifact by your native iOS or Android app.
First, we need to package our React Native app as an XCFramework or Fat-AAR.
53
60
54
-
#### With RNEF
61
+
#### With Rock
55
62
56
-
Follow [Integrating with Native Apps](https://www.rnef.dev/docs/brownfield/intro) steps in RNEF docs and run:
63
+
Follow [Integrating with Native Apps](https://www.rockjs.dev/docs/brownfield/intro) steps in Rock docs and run:
57
64
58
-
-`rnef package:ios` for iOS
59
-
-`rnef package:aar` for Android
65
+
-`rock package:ios` for iOS
66
+
-`rock package:aar` for Android
60
67
61
68
#### With custom scripts
62
69
63
-
Instead of using RNEF, you can create your own custom packaging scripts. Here are base versions for iOS and Android that you'll need to adjust for your project-specific setup:
70
+
Instead of using Rock, you can create your own custom packaging scripts. Here are base versions for iOS and Android that you'll need to adjust for your project-specific setup:
| application | Yes|`Application`| Main application.|
68
+
|reactHost| Exclusively*|`ReactHost`| An instance of [ReactHost](https://github.com/facebook/react-native/blob/main/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactHost.kt). |
69
+
| packages | Exclusively*|`List<ReactPackage>`| List of your React Native Native modules.|
|reactHost|`ReactHost`| null | An instance of [ReactHost](https://github.com/facebook/react-native/blob/main/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactHost.kt). |
159
159
160
160
---
161
161
162
162
**Methods:**
163
163
164
164
`createView`
165
165
166
-
Creates a React Native view with a given module name. It automatically uses an instance of React Native created in `startReactNative` method. This is useful when embedding React Native views directly in your native layouts.
166
+
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.
| context | Yes |`Context`| Android context to create the view |
173
+
| activity | No |`FragmentActivity`| Activity hosting the view, used for lifecycle management |
174
+
| moduleName | Yes |`String`| Name of React Native component registered to `AppRegistry`|
175
+
| launchOptions | No |`Bundle`| Initial properties to be passed to React Native component |
176
176
177
177
Returns:
178
178
`FrameLayout` - A view containing the React Native component.
@@ -193,7 +193,7 @@ container.addView(reactView);
193
193
194
194
#### `ReactNativeFragment`
195
195
196
-
An fragment rendering `ReactRootView` with a given module name. It automatically uses an instance of a React Native created in `startReactNative` method. It works well with exposed JavaScript module. All the lifecycles are proxied to `ReactInstanceManager`. It's the simplest way to embed React Native into your navigation stack.
196
+
An fragment rendering `ReactRootView` with a given module name. It automatically uses an instance of a React Native created in `initialize` method. It works well with exposed JavaScript module. All the lifecycles are proxied to `ReactInstanceManager`. It's the simplest way to embed React Native into your navigation stack.
0 commit comments