Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR clarifies how to pass initial root-component props into a React Native brownfield view across the public APIs, and updates the sample apps to pass an OS version label from native to JS and render it in the UI.
Changes:
- Docs: disambiguate Android
initialize(options)vs view/root initial props (createView(..., launchOptions)), and add initial-props notes for iOS/Android API references. - JS demos: accept
nativeOsVersionLabelas an initial prop and display it (RNApp + Expo RNApp variants). - Native demos: pass OS version via initial props/launch options (Android fragment args; iOS SwiftUI wrapper).
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| docs/docs/docs/api-reference/react-native-brownfield/swift.mdx | Adds guidance about passing root initial props via view(..., initialProps) |
| docs/docs/docs/api-reference/react-native-brownfield/objective-c.mdx | Adds guidance about passing root initial props for Obj-C API |
| docs/docs/docs/api-reference/react-native-brownfield/kotlin.mdx | Adds a note separating initialize(options) from createView(..., launchOptions) + explains launchOptions as initial props |
| docs/docs/docs/api-reference/react-native-brownfield/java.mdx | Same as Kotlin docs note/launchOptions explanation |
| apps/RNApp/src/nativeHostContext.tsx | Introduces context + hook for the native OS version label |
| apps/RNApp/src/HomeScreen.tsx | Renders the OS version label when provided |
| apps/RNApp/src/App.tsx | Accepts nativeOsVersionLabel initial prop and provides it via context |
| apps/ExpoApp55/RNApp.tsx | Accepts and displays nativeOsVersionLabel initial prop |
| apps/ExpoApp54/RNApp.tsx | Accepts and displays nativeOsVersionLabel initial prop |
| apps/AppleApp/Brownfield Apple App/components/ContentView.swift | Passes nativeOsVersionLabel via initialProperties to the RN view |
| apps/AndroidApp/app/src/main/java/com/callstack/brownfield/android/example/MainActivity.kt | Passes nativeOsVersionLabel via fragment ARG_LAUNCH_OPTIONS bundle |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds 2 enhancements:
Test plan
CI green + tested manually.