npm / react-router-dom
react-router-dom
What changed in react-router-dom 6 to 7, from its official release notes, upgrade guides and advisories. Also covers @types/react-router-dom. Sources checked 2026-11-30.
79 breaking1 security18 new APIs and options8 behavior and defaults4 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initreact-router-dom 7109 changes
Breaking changes 79
This export is removed along with the original defer implementation.
The type is removed in favor of inlining unknown where it was used.
The React Router Cloudflare dev proxy is removed; Cloudflare projects should use @cloudflare/vite-plugin instead.
For Remix consumers migrating to React Router, this export is renamed and moved to cloudflareDevProxy from @react-router/dev/vite/cloudflare.
This previously public router export is removed in favor of createBrowserRouter.
This cookie API is provided from react-router rather than platform-specific packages and requires the Web Crypto API crypto global.
This low-level factory API is removed because platform-specific packages no longer need to implement it.
This session API is provided from react-router rather than platform-specific packages and requires the Web Crypto API crypto global.
This low-level factory API is removed because platform-specific packages no longer need to implement it.
This previously public router export is removed in favor of createHashRouter.
This previously public router export is removed in favor of createMemoryRouter.
This session API is provided from react-router rather than platform-specific packages and requires the Web Crypto API crypto global.
This low-level factory API is removed because platform-specific packages no longer need to implement it.
This previously public router export is removed.
This API is renamed from createRemixStub.
This session API is provided from react-router rather than platform-specific packages and requires the Web Crypto API crypto global.
This low-level factory API is removed because platform-specific packages no longer need to implement it.
The router export is removed in favor of the wrapper createStaticHandler in React Router DOM.
The original defer implementation and export are removed in favor of raw promises via single fetch and turbo-stream.
The deprecated router option is removed in favor of mapRouteProperties.
The former esbuild-based compiler is no longer available; the Remix Vite plugin is the way to build full-stack SSR apps.
An exports field is added to all packages, affecting package entry-point resolution.
RemixContext is renamed to FrameworkContext.
This Remix future flag is removed.
The previously flagged fetcher persistence behavior is now the default.
The previously flagged lazy route discovery behavior is now the default.
The previously flagged relative splat path behavior is now the default.
The previously flagged single fetch behavior is now the default.
The previously flagged abort reason behavior is now the default.
The previously flagged fetcher persistence behavior is now the default.
This future flag is removed.
The previously flagged form method normalization behavior is now the default.
This future flag and the RouterProvider fallbackElement prop are removed; move the fallback to hydrateFallbackElement or HydrateFallback on the root route.
The previously flagged partial hydration behavior is now the default.
This future flag is removed from the internalized router package.
The previously flagged relative splat path behavior is now the default.
This React Router future flag is removed.
The previously flagged action status revalidation behavior is now the default.
This future flag is removed.
The previously flagged startTransition behavior is now the default.
This future flag is removed from the internalized router package.
Remove the future.v8_* flags because their behavior is now the default; Framework Mode reports an error if they remain in react-router.config.ts.
This previously public router export is removed.
This previously public React Router export is removed.
With partial hydration, state.navigation remains idle during the initial load rather than being populated.
The deprecated json utility is removed; use Response.json to construct JSON responses.
Use loaderData instead of deprecated data fields in meta arguments, meta matches, and matches returned from useMatches().
The Vite plugin option is removed; use the buildEnd hook, which receives buildManifest.
This is the alternative to the removed detectErrorBoundary option.
React Router v8 requires node@22.22+.
The minimum Node version is 20; Node 18 support is dropped.
React Router v7 requires Node 20; it no longer provides installGlobals to polyfill fetch.
This type replaces PrefetchPageDescriptor.
This previously public React Router export is removed.
This type is replaced by PageLinkDescriptor.
React Router v8 requires react@19.2.7+ and react-dom@19.2.7+.
React Router v7 requires React DOM 18.
The re-export package is removed; import DOM-specific APIs from react-router/dom and other APIs from react-router.
The package is removed starting with v7.
The package is collapsed into react-router; update imports to use react-router.
The minimum supported React version is 18.
The node package no longer re-exports from react-router.
DOM environments should import RouterProvider from react-router/dom to make ReactDOM.flushSync available.
The fallbackElement prop is removed; move the fallback to hydrateFallbackElement or HydrateFallback on the root route.
This previously public React Router export is removed.
The duplicated ServerRuntimeMeta types are removed in favor of the Meta types.
The single_fetch future flag is removed.
This type export is removed along with the original defer implementation.
This export is removed along with the original defer implementation.
This export is removed along with the original defer implementation.
This API is removed in React Router v7.
This API is removed in React Router v7.
The unstable upload handler is removed.
Its generic now expects the type of the function generating the data, such as typeof loader or typeof action, rather than the data type.
The API now exposes its underlying promise instead of previously returning undefined.
The API now exposes its underlying promise instead of previously returning undefined.
This future flag is removed.
Framework mode requires vite@7+ and the future.v8_viteEnvironmentApi flag.
For Remix consumers migrating to React Router, this export is renamed and moved to reactRouter from @react-router/dev/vite.
New APIs and options 18
Opt in to middleware that runs code before and after Response generation for a matched path.
Pass the raw HTTP request to handlers instead of normalizing request.url; use the sibling url parameter for normalized routing logic.
Opt in to splitting client-side route exports into independently loadable chunks, so they can run while the route component downloads.
Preserve trailing-slash semantics in data request URLs using the /_.data format for trailing-slash routes; the root data request changes to /_.data.
Enable support for Vite's experimental Environment API; custom configuration relying on isSsrBuild may need to move under per-environment configuration.
The Vite plugin supports a prerender config as an array of paths or a sync or async function returning paths, generating .html and .data files at build time.
A subpath export is added so DOM environments can use the RouterProvider implementation with ReactDOM.flushSync while react-dom remains an optional peer dependency.
Route component exports can receive params, loaderData, and actionData as props.
When using the Vite plugin, define routes in app/routes.ts and export a RouteConfig using route, index, and layout helpers.
Use the top-level splitRouteModules option instead of future.v8_splitRouteModules; it defaults to true, so set it only for false or "enforce".
Generated route module types can be imported from this path, and typed props are passed to route module component exports.
Generated route-module types are imported from this route-specific path, initially providing inference for params, loader data, and action data.
A sibling handler parameter provides a URL instance representing the normalized location when request.url is passed through raw.
The load API exposes the underlying router promise for composition in React 19 APIs.
Exposes the underlying router promise for composition in React 19 APIs.
The Architect adapter will use event.requestContext.domainName by default, falling back to the Host header; this option can opt in to that behavior on v7.
The revalidate API exposes the underlying router promise for composition in React 19 APIs.
Exposes the underlying router promise for composition in React 19 APIs.
Behavior and default changes 8
The previously flagged dependency optimization behavior is now the default.
For older Node versions, this function now defines globalThis.crypto using Node's webcrypto implementation.
Prefetching support is added when using Remix SSR.
Loaders and actions are allowed to return undefined.
The type is stricter: Record<string, Route> becomes Record<string, Route | undefined>.
The API is stabilized.
The API is stabilized.
The submit API exposes the underlying router promise for composition in React 19 APIs.
Fixes and other changes 4
The react-router-dom APIs have been collapsed into react-router; react-router-dom remains published in v7 as a re-export for migration.
Redirects returned from loaders or actions using data are fixed.
Scroll restoration can now restore properly on an SSR'd document load.
Static prerendering of non-ASCII characters is fixed.
react-router-dom 61 changes
Security 1
React Router: Open redirect leading to XSS