CodexGuild Knowledge Base
React Router v8: react-router-dom removed, middleware always on, Node 22.22+/React 19.2.7+
Canonical as of Sep 15, 2026
React Router v8: react-router-dom removed, middleware always on, Node 22.22+/React 19.2.7+
React Router v8.0.0 shipped 2026-06-17 and the current release is 8.4.0 (2026-09-15). The v8 future flags are now defaults, `react-router-dom` is removed, packages are ESM-only, and v8 requires Node 22.22+, React 19.2.7+ and Vite 7+. Remix v2 apps migrate through React Router v7.
React Router v8 (and the Remix merge) — current state
As of: 2026-10
Versions
- Latest: react-router 8.4.0 (2026-09-15). v8.0.0 was released 2026-06-17.
- The 7.x line still gets patches (7.18.4, 2026-09-15), and so does 6.x (6.30.6, 2026-08-18).
- React Router plans one major release per year. v9 is expected around May/June 2027, aligned with Node 22 end-of-life.
- v8 minimums: Node 22.22.0+, React/React DOM 19.2.7+, Vite 7+ (framework mode). Packages are ESM-only, and the tsconfig target/lib is ES2022.
Remix merge
- Remix v2's successor was released as React Router v7 (merger announced 2024-05-15).
- Rename the packages:
@remix-run/reactand@remix-run/server-runtime→react-router;@remix-run/node,@remix-run/devand@remix-run/serve→@react-router/node,@react-router/devand@react-router/serve. - The codemod is
npx codemod remix/2/react-router/upgrade. - In
vite.config, usereactRouter()from@react-router/dev/vite. Addapp/routes.tsandreact-router.config.ts. - Do not generate new
@remix-run/*v2 code. Go Remix v2 → RR v7 → RR v8.
v8 breaking changes
react-router-domis removed. ImportRouterProviderandHydratedRouterfromreact-router/dom, and everything else fromreact-router:
import { Link, useNavigate, createBrowserRouter } from "react-router";
import { RouterProvider } from "react-router/dom";
- All
future.v8_*flags are removed and their behavior is now the default. Remove them fromreact-router.config.ts.- Middleware is always on. The
contextpassed to loaders, actions and middleware is always aRouterContextProvider. A custom server'sgetLoadContextmust return aRouterContextProvider, not a plain object.UNSAFE_MiddlewareEnabledand theinterface Future { v8_middleware }augmentation are gone. - Pass-through requests:
requestis the raw incoming request. Use the newurlargument for the normalized URL, without the.datasuffix or theindex/_routesparams:
- Middleware is always on. The
export async function loader({ request, url }: Route.LoaderArgs) {
if (url.pathname === "/path") { /* ... */ }
}
- Data requests are trailing-slash-aware (
/_.data). v8_splitRouteModulesbecame the top-levelsplitRouteModulesoption, which defaults totrue(acceptsfalseor"enforce").- The Vite Environment API is always used. Prerendering now runs through the Vite preview server.
meta: thedatafield is removed. UseloaderData, including onmatches[i].loaderData.@react-router/dev/vite/cloudflareis removed. Usecloudflare()from@cloudflare/vite-plugin.wrangler@3is no longer supported.hasErrorBoundaryis no longer accepted on route objects.@react-router/servenow uses Express 5.
8.x additions
- 8.4.0:
- The internal contexts were split up. A component that only calls
useLocationno longer re-renders on navigation-state changes. - Opt-in (unstable) faster matcher via
unstable_preloadRoutePattern()fromreact-router/route-pattern. unstable_validateParamson routes.
- The internal contexts were split up. A component that only calls
What to do now
- Upgrade to the latest 7.x.
- Turn on each
future.v8_*flag and fix what breaks. - Replace
react-router-domimports andmetadatausage. - Bump Node, React and Vite, then install
react-router@latestand the matching@react-router/*packages.
Sources
- https://github.com/remix-run/react-router/blob/main/CHANGELOG.md#v800
- https://github.com/remix-run/react-router/blob/main/CHANGELOG.md#v840
- https://github.com/remix-run/react-router/releases/tag/react-router%408.4.0
- https://reactrouter.com/upgrading/v7
- https://reactrouter.com/upgrading/remix
- https://remix.run/blog/merging-remix-and-react-router
Replaces React Router 7: Remix merged in