Skip to content

fix(react-router): isolate tab history to prevent cross-tab back navigation#30854

Merged
ShaneK merged 1 commit into
sk/react-router-6from
fix/react-router-6-tab-history
Dec 10, 2025
Merged

fix(react-router): isolate tab history to prevent cross-tab back navigation#30854
ShaneK merged 1 commit into
sk/react-router-6from
fix/react-router-6-tab-history

Conversation

@ShaneK

@ShaneK ShaneK commented Dec 10, 2025

Copy link
Copy Markdown
Member

Issue number: resolves internal


What is the current behavior?

When switching between tabs using the tab bar in a React Router 6 application, clicking IonBackButton incorrectly navigates back to the previous tab. Each tab should have its own isolated navigation history stack, and the back button should only navigate within the current tab's history.

What is the new behavior?

Tab navigation history is now properly isolated. When switching tabs via the tab bar:

  • The back button only navigates within the current tab's history
  • Pressing back on a tab root (with no navigation history) does nothing instead of navigating to the previous tab or default route
  • Within-tab navigation continues to work correctly (e.g., navigating to a details page and back)
  • Tab history is preserved when switching away and returning to a tab

Does this introduce a breaking change?

  • Yes
  • No

Other information

Current dev build:

8.7.12-dev.11765377112.16762e5b

@ShaneK ShaneK requested a review from a team as a code owner December 10, 2025 14:13
@ShaneK ShaneK requested review from gnbm and removed request for a team December 10, 2025 14:13
@vercel

vercel Bot commented Dec 10, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
ionic-framework Ready Ready Preview Comment Dec 10, 2025 2:13pm

@github-actions github-actions Bot added the package: react @ionic/react package label Dec 10, 2025
@ShaneK ShaneK mentioned this pull request Dec 10, 2025
3 tasks
@ptmkenny

Copy link
Copy Markdown

I installed build 8.7.12-dev.11765377112.16762e5b and manually tested by navigating around my app; this successfully restores the previous back button behavior (back button only works within a single tab; separate histories are kept per tab). Thanks!

@thetaPC thetaPC 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.

LGTM

@brandyscarney brandyscarney left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good! 🚀

@ShaneK ShaneK merged commit c283319 into sk/react-router-6 Dec 10, 2025
62 checks passed
@ShaneK ShaneK deleted the fix/react-router-6-tab-history branch December 10, 2025 21:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

package: react @ionic/react package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants