Skip to content

Conversation

@ShaneK
Copy link
Member

@ShaneK ShaneK commented Dec 2, 2025

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?

  • Yes
  • No

Other information

Current dev build:

⚠️ WARNING: If you're going to use this dev build on an existing react project, you'll need to migrate to React Router 6. Migrating a large project at this point might be a bad idea since this will not release until v9, which will require further migrations and have other breaking changes! I do not currently have migration documentation for this, but it's a relatively easy process from the migrations I've been doing.

8.7.12-dev.11764873961.1fedca46

thetaPC and others added 30 commits May 8, 2025 14:49
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>
@ShaneK ShaneK requested a review from OS-jacobbell December 2, 2025 22:23
@vercel
Copy link

vercel bot commented Dec 2, 2025

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 4, 2025 7:59pm

@github-actions github-actions bot added the package: react @ionic/react package label Dec 2, 2025
@ShaneK ShaneK marked this pull request as draft December 2, 2025 22:27
@ShaneK ShaneK force-pushed the sk/react-router-6 branch from 6e780d6 to 8a2e91a Compare December 2, 2025 22:59
@ShaneK ShaneK force-pushed the sk/react-router-6 branch from c60a99d to a565a37 Compare December 3, 2025 13:56
@ShaneK ShaneK marked this pull request as ready for review December 3, 2025 14:11
@ShaneK ShaneK requested review from brandyscarney and thetaPC and removed request for OS-jacobbell December 3, 2025 14:20
@mhartington
Copy link
Contributor

Took you long enough...Good job shane

fail-fast: false
matrix:
apps: [reactrouter5]
apps: [reactrouter6]
Copy link
Member

Choose a reason for hiding this comment

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

We should either update the breaking changes file to include no longer supporting react router 5 or create a follow-up task since doing so might conflict with next: https://github.com/ionic-team/ionic-framework/blob/next/BREAKING.md

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, I still need to document migration strategies and such. For the most part, it's a pretty easy migration (ignore the inline overlay stuff, that was all removed), but I just need to write it out.

Copy link
Member Author

Choose a reason for hiding this comment

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

I went ahead and did this in this branch, figuring it would be an easy enough merge conflict resolution. If you'd like to review in an easier to read way:
https://github.com/ionic-team/ionic-framework/blob/b2a71050344052a4858d0c8b6712f0d5bc9d7219/BREAKING.md

@ShaneK ShaneK mentioned this pull request Dec 3, 2025
3 tasks
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.

5 participants