Skip to content

Upgrade react-navigation to newest eligible 7.x releases - #103699

Merged
mountiny merged 11 commits into
Expensify:mainfrom
callstack-internal:daily/101715-upgrade-react-navigation
Oct 12, 2026
Merged

mountiny merged 11 commits into
Expensify:mainfrom
callstack-internal:daily/101715-upgrade-react-navigation

Conversation

@TMisiukiewicz

Copy link
Copy Markdown
Contributor

Supersedes #102146 (moved to a branch I can push to).

Explanation of Change

Bump the react-navigation family to the newest releases this repo's min-release-age policy allows, re-port the vendored patch set onto the new versions, and drop two patches upstream now covers. No app navigation code was rewritten.

Package From To
@react-navigation/native 7.1.33 7.4.1
@react-navigation/core 7.21.12 7.22.1
@react-navigation/stack 7.8.5 7.11.2
@react-navigation/native-stack 7.14.5 7.19.2
@react-navigation/bottom-tabs 7.15.5 7.19.2
@react-navigation/material-top-tabs 7.4.19 7.7.2
@react-navigation/devtools (dev) 7.0.52 7.1.15
@react-navigation/elements (transitive) 2.9.14 2.9.43
@react-navigation/routers (transitive) 7.6.4 unchanged
react-native-tab-view 4.3.0 4.3.2

.npmrc sets min-release-age=7, so these are the newest releases at least seven days old. A newer batch published 2026-09-29 (native 7.5.0, core 7.23.0, stack 7.12.0) becomes installable around 2026-10-06 and is left for a follow-up.

Patches. All 13 react-navigation and 5 react-native-tab-view patch files were regenerated against the new versions. Per-patch reasons and re-port notes are in patches/react-navigation/details.md and patches/react-native-tab-view/details.md. Summary:

  • 12 re-ported, with bodies unchanged or re-anchored only. native+001+initial needed hand re-anchoring because upstream rewrote useLinking and createMemoryHistory.
  • Removed native+003+increase-history-go-popstate-fallback-timeout. Upstream shipped the same 100ms to 1000ms raise in 7.3.18 (#13217).
  • Removed stack+005+clip-inactive-card-inside-card from feat: use floating RHP style on web #101093. Upstream shipped it in 7.11.2 (#13255). Verified the floating RHP card shadow still renders.
  • Added core+003+root-state-not-undefined. Types only. Upstream narrowed getRootState() to NavigationState | undefined while the runtime has always returned undefined before the container mounts. The src/ call sites assume a state exists and all run behind navigationRef.isReady(), so guarding each one is a separate refactor.

One behaviour change. Since 7.3.8, createMemoryHistory.go() rejects with History was changed during navigation. when the browser never lands on the target entry, where 7.1.33 resolved. useLinking already catches it, and the difference is that the trailing history.replace is skipped. This is the code path #94571 (Firefox back button after a redirect) lives in, and it was verified on Firefox.

App changes. Two comments in src/libs/Navigation/PlatformStackNavigation/createPlatformStackNavigatorComponent/ (index.tsx, index.native.tsx). Core 7.22.0 deprecated NavigationContent in favour of a render callback (#13238) and @typescript-eslint/no-deprecated is enabled here. Migrating that builder to the render callback sits on the render path of every stack in the app and belongs in its own PR.

Lockfile. standard-navigation@0.0.8 appears, pulled in by native. It is types only and is not bundled by Metro or webpack. core drops query-string, which also removes decode-uri-component and filter-obj. Nothing in src/ imported them.

Fixed Issues

$ #101715
PROPOSAL:

Tests

Automated, on this branch after merging main:

  1. npm run typecheck, after deleting the *.tsbuildinfo caches: exit 0.
  2. bash scripts/validatePatches.sh: exit 0.
  3. Clean reinstall (rm -rf node_modules/@react-navigation node_modules/react-native-tab-view, npm install --ignore-scripts, bun scripts/applyPatches.ts): patch-package succeeded with no errors or warnings.
  4. npx jest tests/navigation tests/unit/Navigation: 96 suites, 1320 tests, all passing.
  5. npx jest tests/unit/Navigation/createMemoryHistoryTest.ts: 2 passing. Updated in this PR to assert the new rejection contract.
  6. npx eslint --report-unused-disable-directives on the changed TypeScript files and npm run spell-changed: clean.

Manual, each run against this branch's own bundle:

  1. Web: sign in, switch bottom and top tabs, push and pop the stack, browser back and forward including a multi-step history.go(-3) and rapid consecutive traversals, and reload a deep link. No console errors beyond pre-existing dev environment noise.
  2. iOS native: cold start, navigation state restoration, stack push and pop, edge-swipe back gesture, bottom and top tabs. No crashes.
  3. Android native: cold start, stack push and pop, hardware Back button, pager swipe between the Spend tabs, bottom and top tabs. No crashes.
  4. Web floating RHP: open an expense over an expense report on a wide layout and verify the card under the focused one keeps its left and bottom shadow. This covers the removed stack+005.
  5. Firefox: sign in, push and pop the stack, browser back and forward, and the [Due for payment 2026-07-29] [$250] Chat - The new group chat doesn't open in Firefox #94571 path (deep link to a report that redirects, then browser Back). Navigation lands on the right screen, the history stays consistent across back, forward and reload, and there are no unhandled rejections or error boundaries. This is the browser where the go() rejection change above and [Due for payment 2026-07-29] [$250] Chat - The new group chat doesn't open in Firefox #94571 live.

Offline tests

Same as tests. Nothing in this diff changes offline behaviour or persists navigation state differently.

QA Steps

Same as tests 7 through 10, on staging builds for Android mWeb Chrome, iOS mWeb Safari and iOS/Android native. The change is in the JS navigation layer, so coverage is transitions and web history rather than data.

  • Verify that no errors appear in the JS console

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android: Native
    • Android: mWeb Chrome
    • iOS: Native
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I followed proper code patterns (see Reviewing the code)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))
  • If new assets were added or existing ones were modified, I verified that:
    • The assets are optimized and compressed (for SVG files, run npm run compress-svg)
    • The assets load correctly across all supported platforms.
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • If the PR adds or modifies the UI:
    • I asked an AI agent to review the changes for accessibility issues and addressed its findings.
    • I tested with a screen reader (VoiceOver on macOS) and verified all new/changed elements are reachable with a logical focus order.
    • I verified all new/changed elements have meaningful accessible names and roles.
    • I verified state changes are announced (e.g. checked/unchecked, expanded/collapsed, selected).
  • I added unit tests for any new feature or bug fix in this PR to help automatically prevent regressions in this user flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.

Screenshots/Videos

Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari

🤖 Generated with Claude Code

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ This PR is possibly changing native code and/or updating libraries, it may cause problems with HybridApp. Please check if any patch updates are required in the HybridApp repo and run an AdHoc build to verify that HybridApp will not break. Ask Contributor Plus for help if you are not sure how to handle this. ⚠️

@github-actions

Copy link
Copy Markdown
Contributor

🚧 dylanexpensify has triggered a test Expensify/App build. You can view the workflow run here.

@github-actions

This comment has been minimized.

…react-navigation

# Conflicts:
#	package-lock.json
#	package.json
#	patches/react-navigation/@react-navigation+bottom-tabs+7.15.5+001+fix-failing-jest-by-disabling-esmodule.patch
#	patches/react-navigation/@react-navigation+bottom-tabs+7.18.16+001+fix-failing-jest-by-disabling-esmodule.patch
#	patches/react-navigation/@react-navigation+bottom-tabs+7.19.2+001+fix-failing-jest-by-disabling-esmodule.patch
#	patches/react-navigation/@react-navigation+elements+2.9.14+001+fix-failing-jest-by-disabling-esmodule.patch
#	patches/react-navigation/@react-navigation+elements+2.9.38+001+fix-failing-jest-by-disabling-esmodule.patch
#	patches/react-navigation/@react-navigation+elements+2.9.43+001+fix-failing-jest-by-disabling-esmodule.patch
#	patches/react-navigation/@react-navigation+native+7.1.33+001+initial.patch
#	patches/react-navigation/@react-navigation+native+7.1.33+002+fix-failing-jest-by-disabling-esmodule.patch
#	patches/react-navigation/@react-navigation+native+7.3.16+001+initial.patch
#	patches/react-navigation/@react-navigation+native+7.3.16+002+fix-failing-jest-by-disabling-esmodule.patch
#	patches/react-navigation/@react-navigation+native+7.3.16+003+increase-history-go-popstate-fallback-timeout.patch
#	patches/react-navigation/@react-navigation+native+7.4.1+001+initial.patch
#	patches/react-navigation/@react-navigation+native+7.4.1+002+fix-failing-jest-by-disabling-esmodule.patch
#	patches/react-navigation/details.md
#	tests/unit/Navigation/createMemoryHistoryTest.ts
@shubham1206agra

Copy link
Copy Markdown
Contributor

Reviewer Checklist

  • I have verified the author checklist is complete (all boxes are checked off).
  • I verified the correct issue is linked in the ### Fixed Issues section above
  • I verified testing steps are clear and they cover the changes made in this PR
    • I verified the steps for local testing are in the Tests section
    • I verified the steps for Staging and/or Production testing are in the QA steps section
    • I verified the steps cover any possible failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
  • I checked that screenshots or videos are included for tests on all platforms
  • I included screenshots or videos for tests on all platforms
  • I verified that the composer does not automatically focus or open the keyboard on mobile unless explicitly intended. This includes checking that returning the app from the background does not unexpectedly open the keyboard.
  • I verified tests pass on all platforms & I tested again on:
    • Android: HybridApp
    • Android: mWeb Chrome
    • iOS: HybridApp
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • If there are any errors in the console that are unrelated to this PR, I either fixed them (preferred) or linked to where I reported them in Slack
  • I verified proper code patterns were followed (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick).
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I verified that this PR follows the guidelines as stated in the Review Guidelines
  • I verified other components that can be impacted by these changes have been tested, and I retested again (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar have been tested & I retested again)
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately and each prop has a /** comment above it */
    • The file is named correctly
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • For Class Components, any internal methods passed to components event handlers are bound to this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
    • Any internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
    • All JSX used for rendering exists in the render method
    • The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • For any bug fix or new feature in this PR, I verified that sufficient unit tests are included to prevent regressions in this flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.
  • I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

Screenshots/Videos

Screen.Recording.2026-10-12.at.4.29.19.PM.mov
WhatsApp.Video.2026-10-12.at.16.40.28.mp4

@shubham1206agra

Copy link
Copy Markdown
Contributor

@TMisiukiewicz Can you please ready this PR for review?

@TMisiukiewicz
TMisiukiewicz marked this pull request as ready for review October 12, 2026 11:15
@TMisiukiewicz
TMisiukiewicz requested review from a team as code owners October 12, 2026 11:15
@melvin-bot
melvin-bot Bot requested review from dylanexpensify and shubham1206agra and removed request for a team October 12, 2026 11:16
@melvin-bot

melvin-bot Bot commented Oct 12, 2026

Copy link
Copy Markdown

@shubham1206agra Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

@melvin-bot
melvin-bot Bot removed the request for review from a team October 12, 2026 11:16
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-12T11:30:08.500655Z 47d9481 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@melvin-bot
melvin-bot Bot requested a review from mountiny October 12, 2026 11:18

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 47d9481fa6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread patches/react-navigation/@react-navigation+native+7.4.1+001+initial.patch Outdated
Comment thread patches/react-navigation/@react-navigation+native+7.4.1+001+initial.patch Outdated
- Guard the stale history diff navigation with a try/catch to swallow interrupted navigations
- Subtract pendingPopStateDelta from historyDeltaByKeys to keep history deltas in sync
- Remove now-unneeded no-deprecated eslint-disable for NavigationContent and seatbelt the lint error instead

@mountiny mountiny left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for taking over and pushing it ahead. Looks good to me.

@mountiny
mountiny merged commit 3faeb65 into Expensify:main Oct 12, 2026
43 of 44 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

🚧 mountiny has triggered a test Expensify/App build. You can view the workflow run here.

@OSBotify

Copy link
Copy Markdown
Contributor

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@TaduJR

TaduJR commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

I think we have a regression from this PR. Can anyone check if it is?

Mac-Chrome.mp4

@TaduJR

TaduJR commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

Nevermind. The offending PR is #103346

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/mountiny in version: 9.5.8-0 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/cristipaval in version: 9.5.8-5 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

Bundle Size Analysis (Sentry):

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.

6 participants