Skip to content
Home / Migrations / Remix v2React Router v7

Remix v2 React Router v7

easy

React Router v7 IS Remix v3. The Remix team merged into React Router. Migration is mostly a package rename with a codemod that handles 90% of changes.

Estimated: 1-3h · 5 steps
Progress0%
Step 1: Run the codemod
npx codemod react-router/v7
Step 2: Update package.json

Replace @remix-run/react, @remix-run/node, @remix-run/serve with react-router and @react-router/node, @react-router/serve.

npm uninstall @remix-run/react @remix-run/node && npm install react-router @react-router/node
Step 3: Update imports

All @remix-run/react imports → react-router. @remix-run/node imports → @react-router/node. The codemod handles most of these.

Step 4: Update vite.config.ts

Replace @remix-run/dev/vite with @react-router/dev/vite.

import { reactRouter } from '@react-router/dev/vite'
Step 5: Verify routes

Route config in routes.ts is unchanged. File-based routing with routes/ directory works identically.

Dev server starts, routes render, loaders/actions work