-
Notifications
You must be signed in to change notification settings - Fork 13.4k
feat(react-router): upgrade to react router 6 #30831
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: major-9.0
Are you sure you want to change the base?
Conversation
Co-authored-by: Sean Perkins <13732623+sean-perkins@users.noreply.github.com>
…ter 6 Co-authored-by: Sean Perkins <13732623+sean-perkins@users.noreply.github.com>
…ct router 6 Co-authored-by: Sean Perkins <13732623+sean-perkins@users.noreply.github.com>
… router 6 Co-authored-by: Sean Perkins <13732623+sean-perkins@users.noreply.github.com>
0c82ee2 to
6a61ecf
Compare
brandyscarney
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking really good! 🚀 My comments are mostly questions & potential issues with either the test app or the router code.
packages/react-router/src/ReactRouter/utils/computeParentPath.ts
Outdated
Show resolved
Hide resolved
…RouterOutlet (#30844) Issue number: resolves [an issue from a comment](#24177 (comment)) --------- ## What is the current behavior? <!-- Please describe the current behavior that you are modifying. --> Currently, Ionic's RR6 doesn't support relative routes in the same way RR6 does. Routes that do not start with a `/`do not work in the Ionic RR6 implementation in some cases. ## What is the new behavior? With this change, we properly support these route styles and more closely align with normal RR6 route support. ## Does this introduce a breaking change? - [ ] Yes - [X] No <!-- If this introduces a breaking change: 1. Describe the impact and migration path for existing applications below. 2. Update the BREAKING.md file with the breaking change. 3. Add "BREAKING CHANGE: [...]" to the commit description when merging. See https://github.com/ionic-team/ionic-framework/blob/main/docs/CONTRIBUTING.md#footer for more information. --> ## Other information Current dev build: ``` 8.7.12-dev.11765307927.1f491e92 ``` This PR will be merged into the RR6 branch, which will be squash+merged into the major 9 branch. This will prevent major 9 from having commits in the change log on release that reference fixing things that are only available in major 9.
…p, and a bit of ordering
2929474 to
ab3dde2
Compare
brandyscarney
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Woooooooo! 🚀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be great to add a not on Page 3 that using the back button will navigate the user to Page 1. I had to check the code to verify what the expected result should be. By adding a note, we can quickly determine what the end result should be,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found an issue where the active styles are not matching when using the buttons. Notice in the video that both tab buttons have active styles.
Screen.Recording.2026-01-05.at.5.03.13.PM.mov
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found an issue that the URL and page doesn't match when also using the browser back buttons. My example uses list #1 but it also happens for any list item.
Screen.Recording.2026-01-05.at.4.56.59.PM.mov
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the point of this page? I'm not following the importance. It would be great to add a note to make it easier for testing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found an issue with Child 2 not rendering the right page when using the browser's buttons. The same for Child 1.
Screen.Recording.2026-01-05.at.5.20.06.PM.mov
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm seeing an issue with active styles on the tab buttons.
Screen.Recording.2026-01-05.at.5.23.45.PM.mov
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pages and URLs do not match when using the browser's buttons.
Screen.Recording.2026-01-05.at.5.25.18.PM.mov
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found an issue with the toolbar overlapping when using the browser's buttons.
Screen.Recording.2026-01-07.at.9.35.05.AM.mov
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found an issue with page and URL not matching when navigating from root.
Screen.Recording.2026-01-07.at.9.39.02.AM.mov
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found an issue with page and URL not matching when using browser's buttons.
Screen.Recording.2026-01-07.at.9.42.38.AM.mov
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found an issue with active styles on the tab buttons when navigating from root.
Screen.Recording.2026-01-07.at.9.44.39.AM.mov
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found an issue with page and URL not matching when using the browser's buttons from root. Also there's a flicker of the root page during navigation.
Screen.Recording.2026-01-07.at.9.47.03.AM.mov
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found an issue with page and URL not matching when using the browser's buttons.
Screen.Recording.2026-01-07.at.9.50.43.AM.mov
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed the items from the list. When I use the browser's back button, I eventually see the list filled with the deleted items. I would expect the list to be deleted. What is the correct expectation?
Issue number: resolves #24177
What is the current behavior?
Currently, Ionic Framework React Router only supports React Router 5. This has many issues and unsupported/broken features.
What is the new behavior?
With this change, Ionic Framework will support React Router 6 while still supporting transitions in the same way a native app does.
Most of what caused this change to take a long time is that React Router 5 and React Router 6 have fundamental differences in how they handle components once they're no longer part of the view. In this change, we move away from relying on React Router directly so much and have our own implementation for deciding how views get dealt with during navigation and when they're cleaned up, allowing for us to still transition between them like we need to while still using React Router as much as we possibly can.
This change will also lay the foundation for the migration to React Router 7, which will ideally be easier since most of the hard work has been dealt with here.
Does this introduce a breaking change?
Other information
Current dev build (last updated 2025-12-18):