Skip to content

Upgrade React Router from v6 to v7 #457

@jcraigk

Description

@jcraigk

Summary

We're currently on react-router-dom v6.x (^6.26.2). React Router v7 has been stable since November 2024 and is actively maintained.

We've already opted into the v7 future flags (v7_startTransition and v7_relativeSplatPath) in App.jsx, which gets us partway there.

Upgrade notes

  • React Router v7 merges Remix into React Router and changes the package structure
  • Imports change from react-router-dom to react-router
  • New concepts like framework mode are available but optional
  • See the official upgrade guide: https://reactrouter.com/upgrading/v6

Steps

  1. Review the upgrade guide
  2. Update the dependency in package.json to v7
  3. Update imports across the codebase (react-router-domreact-router)
  4. Remove the future flags from createBrowserRouter (they become defaults in v7)
  5. Test thoroughly

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions