Skip to content

Commit 0d9005c

Browse files
committed
docs: clear documentation on initial properties from native to RN
1 parent 825e293 commit 0d9005c

4 files changed

Lines changed: 16 additions & 2 deletions

File tree

docs/docs/docs/api-reference/react-native-brownfield/java.mdx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,10 @@ A function used to initialize a React Native Brownfield singleton. Keep in mind
6464

6565
> `*` - From the marked fields, exactly one must be specified, excluding the others. See examples below.
6666
67-
**Available options:**
67+
> [!Note]
68+
> The `options` map for `initialize` is unrelated to the initial props passed to the root component. For passing in initial props, use the [`launchOptions` argument of `createView`](#createview).
69+
70+
**Available `options` entries:**
6871

6972
- `useDeveloperSupport`: `Boolean` - Flag to use dev support.
7073
- `packages`: `List<ReactPackage>` - List of your React Native Native modules.
@@ -167,6 +170,8 @@ Creates a React Native view with a given module name. It automatically uses an i
167170

168171
Returns: `FrameLayout` - A view containing the React Native component.
169172

173+
Root initial props can be passed through the `launchOptions` argument of `createView`. That `Bundle` is forwarded as the root view's initial properties - the same concept as [initial props on `ReactRootView`](https://reactnative.dev/docs/communication-android#passing-properties-from-native-to-react-native).
174+
170175
**Examples:**
171176

172177
```java

docs/docs/docs/api-reference/react-native-brownfield/kotlin.mdx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,10 @@ A function used to initialize a React Native Brownfield singleton. Keep in mind
4747

4848
> `*` - From the marked fields, exactly one must be specified, excluding the others. See examples below.
4949
50-
**Available options:**
50+
> [!Note]
51+
> The `options` map for `initialize` is unrelated to the initial props passed to the root component. For passing in initial props, use the [`launchOptions` argument of `createView`](#createview).
52+
53+
**Available `options` entries:**
5154

5255
- `useDeveloperSupport`: `Boolean` - Flag to use dev support.
5356
- `packages`: `List<ReactPackage>` - List of your React Native Native modules.
@@ -146,6 +149,8 @@ Creates a React Native view with a given module name. It automatically uses an i
146149

147150
Returns: `FrameLayout` - A view containing the React Native component.
148151

152+
Root initial props can be passed through the `launchOptions` argument of `createView`. That `Bundle` is forwarded as the root view's initial properties - the same concept as [initial props on `ReactRootView`](https://reactnative.dev/docs/communication-android#passing-properties-from-native-to-react-native).
153+
149154
**Examples:**
150155

151156
```kotlin

docs/docs/docs/api-reference/react-native-brownfield/objective-c.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ Starts React Native, produces an instance of React Native. You can use it to ini
4747
| ---------------- | -------- | --------------- | ------------------------------------------------- |
4848
| `onBundleLoaded` | No | `void(^)(void)` | Callback invoked after JS bundle is fully loaded. |
4949

50+
Root initial props can be passed through the `initialProps` argument of `createView`. That `NSDictionary` is forwarded as the root view's initial properties - the same concept as [initial props on `ReactRootView`](https://reactnative.dev/docs/communication-android#passing-properties-from-native-to-react-native).
51+
5052
**Examples:**
5153

5254
```objc

docs/docs/docs/api-reference/react-native-brownfield/swift.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ Starts React Native. You can use it to initialize React Native in your app.
4747
| ---------------- | -------- | --------------- | ------------------------------------------------- |
4848
| `onBundleLoaded` | No | `(() -> Void)?` | Callback invoked after JS bundle is fully loaded. |
4949

50+
Root initial props can be passed through the `initialProps` argument of `view`. That `[AnyHashable: Any]?` is forwarded as the root view's initial properties - the same concept as [initial props on `ReactRootView`](https://reactnative.dev/docs/communication-android#passing-properties-from-native-to-react-native).
51+
5052
**Examples:**
5153

5254
```swift

0 commit comments

Comments
 (0)