React Router v7 is Remix "v3". So if you're up to date with all future flags in Remix v2, the upgrade to v7 is non-breaking aside from changing imports.
First update to the latest minor version of Remix v2 and then the console will warn you for any flags that you have not enabled.
export interface FutureConfig {
// TODO: document the future flags
}
You can use the following command that will automatically:
From the root of your project run:
npx upgrade-remix v7
If you prefer to do it manually, here's a list of the equivalent packages:
Remix v2 Package | React Router v7 Package | |
---|---|---|
@remix-run/react |
β‘οΈ | react-router-dom |
@remix-run/dev |
β‘οΈ | @react-router/dev |
@remix-run/node |
β‘οΈ | @react-router/node |
@remix-run/cloudflare |
β‘οΈ | @react-router/cloudflare |
TODO: get the whole list |
Also note that nearly all modules your app needs can come from react-router-dom
instead of @remix-run/node
and @remix-run/cloudflare
, so try to import from there first.
-import { redirect } from "@react-router/node";
+import { redirect } from "react-router";