Skip to content

Commit bca6dfa

Browse files
committed
docs: updated docs
1 parent 3dc3343 commit bca6dfa

6 files changed

Lines changed: 32 additions & 17 deletions

File tree

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

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -183,10 +183,13 @@ container.addView(reactView);
183183

184184
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.
185185

186-
| Param | Required | Type | Description |
187-
| ------- | -------- | -------- | ---------------------------------- |
186+
| Param | Required | Type | Description |
187+
| ------- | -------- | -------- | ----------------------------------- |
188188
| message | Yes | `String` | A JSON-encoded string to send to JS |
189189

190+
> [!Note]
191+
> This method is available only on the New Architecture; on Old Architecture, it will be a no-op.
192+
190193
**Example:**
191194

192195
```java
@@ -203,9 +206,9 @@ ReactNativeBrownfield.getShared().postMessage(payload.toString());
203206

204207
Register a listener for messages sent from JavaScript via `ReactNativeBrownfield.postMessage()`.
205208

206-
| Param | Required | Type | Description |
207-
| -------- | -------- | ------------------- | -------------------------------------------- |
208-
| listener | Yes | `OnMessageListener` | Callback invoked with the raw JSON string |
209+
| Param | Required | Type | Description |
210+
| -------- | -------- | ------------------- | ----------------------------------------- |
211+
| listener | Yes | `OnMessageListener` | Callback invoked with the raw JSON string |
209212

210213
**Example:**
211214

@@ -224,9 +227,9 @@ ReactNativeBrownfield.getShared().addMessageListener(listener);
224227

225228
Remove a previously registered message listener.
226229

227-
| Param | Required | Type | Description |
228-
| -------- | -------- | ------------------- | ------------------------ |
229-
| listener | Yes | `OnMessageListener` | The listener to remove |
230+
| Param | Required | Type | Description |
231+
| -------- | -------- | ------------------- | ---------------------- |
232+
| listener | Yes | `OnMessageListener` | The listener to remove |
230233

231234
**Example:**
232235

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ ReactNativeBrownfield.postMessage(data: any);
6666
| ----- | ----- | ------------------------------------------------------ |
6767
| data | `any` | Any JSON-serializable value to send to the native host |
6868

69+
> [!Note]
70+
> This method is available both on the New Architecture and the Old Architecture.
71+
6972
**Example:**
7073

7174
```ts

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

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -172,10 +172,13 @@ AndroidView(
172172

173173
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.
174174

175-
| Param | Required | Type | Description |
176-
| ------- | -------- | -------- | ---------------------------------- |
175+
| Param | Required | Type | Description |
176+
| ------- | -------- | -------- | ----------------------------------- |
177177
| message | Yes | `String` | A JSON-encoded string to send to JS |
178178

179+
> [!Note]
180+
> This method is available only on the New Architecture; on Old Architecture, it will be a no-op.
181+
179182
**Example:**
180183

181184
```kotlin
@@ -192,9 +195,9 @@ ReactNativeBrownfield.shared.postMessage(payload.toString())
192195

193196
Register a listener for messages sent from JavaScript via `ReactNativeBrownfield.postMessage()`.
194197

195-
| Param | Required | Type | Description |
196-
| -------- | -------- | ------------------- | -------------------------------------------- |
197-
| listener | Yes | `OnMessageListener` | Callback invoked with the raw JSON string |
198+
| Param | Required | Type | Description |
199+
| -------- | -------- | ------------------- | ----------------------------------------- |
200+
| listener | Yes | `OnMessageListener` | Callback invoked with the raw JSON string |
198201

199202
**Example:**
200203

@@ -213,9 +216,9 @@ ReactNativeBrownfield.shared.addMessageListener(listener)
213216

214217
Remove a previously registered message listener.
215218

216-
| Param | Required | Type | Description |
217-
| -------- | -------- | ------------------- | ------------------------ |
218-
| listener | Yes | `OnMessageListener` | The listener to remove |
219+
| Param | Required | Type | Description |
220+
| -------- | -------- | ------------------- | ---------------------- |
221+
| listener | Yes | `OnMessageListener` | The listener to remove |
219222

220223
**Example:**
221224

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@ Send a JSON string to the React Native JS layer. The message is delivered as a `
9090
| --------- | -------- | ---------- | ----------------------------------- |
9191
| `message` | Yes | `NSString` | A JSON-encoded string to send to JS |
9292
93+
> [!Note]
94+
> This method is available only on the New Architecture; on Old Architecture, it will be a no-op.
95+
9396
**Examples:**
9497
9598
```objc

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@ Send a JSON string to the React Native JS layer. The message is delivered as a `
9494
| --------- | -------- | -------- | ----------------------------------- |
9595
| `message` | Yes | `String` | A JSON-encoded string to send to JS |
9696

97+
> [!Note]
98+
> This method is available only on the New Architecture; on Old Architecture, it will be a no-op.
99+
97100
**Examples:**
98101

99102
```swift

docs/docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ features:
1919
details: Package your React Native app as XCFramework (iOS) or AAR (Android) for easy distribution with <code>brownfield</code> CLI.
2020
icon: <img src="/react-native-brownfield/animation.svg" />
2121
- title: Type-safe state sync
22-
details: Single-source-of-truth state synchronization between React Native and native code with type-safe code generation from TypeScript to Swift with Brownie library.
22+
details: Comes with a message exchange lag between native and RN. <br/> <br/> Single-source-of-truth state synchronization between React Native and native code with type-safe code generation from TypeScript to Swift with Brownie library.
2323
icon: <img src="/react-native-brownfield/arrows-horizontal.svg" />
2424
- title: Modern UI frameworks supported
2525
details: First-class support for modern UI frameworks including SwiftUI and Jetpack Compose.

0 commit comments

Comments
 (0)