Skip to content

feat: add brownfield navigation#236

Open
hurali97 wants to merge 19 commits intomainfrom
feat/brownfield-navigation
Open

feat: add brownfield navigation#236
hurali97 wants to merge 19 commits intomainfrom
feat/brownfield-navigation

Conversation

@hurali97
Copy link
Member

@hurali97 hurali97 commented Feb 22, 2026

Summary

This adds the brownfield-navigation package which allows streamlining presenting native screens from react-native. The usage is as simple as:

  • Add brownfield.navigation.ts:
export interface BrownfieldNavigationSpec {
  navigateToSettings(): void;
  navigateToReferrals(userId: string): void;
}
  • Call functions from React Native
<Button
  title="Open native settings"
  onPress={() => BrownfieldNavigation.navigateToSettings()}
/>
<Button
  title="Open native referrals"
  onPress={() => BrownfieldNavigation.navigateToReferrals('user-123')}
/>
  • Generate the AAR/XCFramework using brownfield-cli

That is all from react-native side, now ship the artifacts to the native team and they will do the final wiring, which is below steps.


  • Create the delegate in your native App
// SwiftUI
public final class RNNavigationDelegate: BrownfieldNavigationDelegate {
  public func navigateToSettings() {
    present(SettingsScreen())
  }

  public func navigateToReferrals(userId: String) {
    present(ReferralsScreen(userId: userId))
  }

  private func present<Content: View>(_ view: Content) {
    // present VC
  }
}
  • Register the delegate
init() {
  BrownfieldNavigationManager.shared.setDelegate(
    navigationDelegate: RNNavigationDelegate()
)

Test plan

  • CI Passes - 🟢
  • Verified Locally - 🟢

Android

Details
Screen.Recording.2026-02-26.at.5.07.46.PM.mov

iOS

Details
Simulator.Screen.Recording.-.iPhone.17.Pro.-.2026-02-26.at.16.28.57.mov

@hurali97 hurali97 force-pushed the feat/brownfield-navigation branch from 40d81e9 to 7364f91 Compare February 24, 2026 09:46
@hurali97 hurali97 force-pushed the feat/brownfield-navigation branch from 3261cbd to 8e2db27 Compare February 26, 2026 12:11
Comment on lines +2 to +3
'@callstack/brownfield-navigation': minor
'@callstack/brownfield-cli': minor
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we go with a major version bump? To maintain parity with react-native-brownfield, I have set the version to 3.0.0 for brownfield-navigation and doing a minor bump here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Always sync

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bumped all minors to align.

@hurali97 hurali97 changed the title Feat/brownfield navigation feat: add brownfield navigation Feb 27, 2026
@hurali97 hurali97 marked this pull request as ready for review February 27, 2026 08:04
Copilot AI review requested due to automatic review settings February 27, 2026 08:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants