react-router
8.5.1 · 27 Oct 2026MIT80.5M / weekRepositorynpmAtom feed
7.18.6 is the newest release of 7.x.
In short
23 breaking3 removed6 new7 fixed17 changed1 internal
- Breaking
Remove single fetch future flag.
- Breaking
Drop support for Node 16, React Router SSR now requires Node 18 or higher
- Breaking
Remove
future.v7_startTransitionflag - Breaking
Remove
future.v7_normalizeFormMethodfuture flag - Breaking
Update minimum node version to 18
- Breaking
Remove
future.v7_prependBasenamefrom the ionternalized@remix-run/routerpackage - Breaking
Migrate Remix type generics to React Router
- Breaking
Remove
future.v7_throwAbortReasonfrom internalized@remix-run/routerpackage
Security
13 advisories affect 7.0.0; 7.18.0 fixes them
- HighReact Router: Unauthenticated Denial of Service via Inefficient Route MatchingGHSA-chx6-hx7r-mcp5 · 24 Jul 2026Fixed in 7.18.0
- HighReact Router vulnerable to Denial of Service via reflected user input in single-fetchGHSA-rxv8-25v2-qmq8 · 4 Jun 2026Fixed in 7.14.0
- HighReact Router vulnerable to DoS via unbounded path expansion in __manifest endpointGHSA-8x6r-g9mw-2r78 · 3 Jun 2026Fixed in 7.15.0
- HighReact Router's vendored turbo-stream v2 allows arbitrary constructor invocation via TYPE_ERROR deserialization leading to Unauth RCEGHSA-49rj-9fvp-4h2h · 3 Jun 2026Fixed in 7.14.2
- HighReact Router vulnerable to XSS via Open RedirectsGHSA-2w69-qvjg-hvjx · 8 Jan 2026Fixed in 7.12.0
8 more
- HighReact Router SSR XSS in ScrollRestorationGHSA-8v8x-cx79-35w7 · 8 Jan 2026Fixed in 7.12.0
- HighReact Router has XSS VulnerabilityGHSA-3cgp-3xvw-98x8 · 8 Jan 2026Fixed in 7.9.0
- HighReact Router allows pre-render data spoofing on React-Router framework modeGHSA-cpj6-fhp6-mr6j · 24 Apr 2025Fixed in 7.5.2
- ModerateReact Router: Open redirect via backslash in <Link> and useNavigate (CVE-2025-68470 bypass)GHSA-wrjc-x8rr-h8h6 · 23 Jul 2026Fixed in 7.18.0
- ModerateReact Router: Arbitrary Constructor Injection via deserializeErrors() in React Router SSR HydrationGHSA-337j-9hxr-rhxg · 23 Jul 2026Fixed in 7.18.0
- ModerateReact Router's same-origin redirect with path starting // causes open redirect via protocol-relative URL reinterpretationGHSA-2j2x-hqr9-3h42 · 3 Jun 2026Fixed in 7.14.1
- ModerateReact Router has CSRF issue in Action/Server Action Request ProcessingGHSA-h5cw-625j-3rxh · 8 Jan 2026Fixed in 7.12.0
- ModerateReact Router has unexpected external redirect via untrusted pathsGHSA-9jcx-v3wj-wh4m · 8 Jan 2026Fixed in 7.9.6
Release note
The section about react-router of a note shared by several packages.
Major Changes
- Breaking
Remove the original
deferimplementation in favor of using raw promises via single fetch andturbo-stream. This removes these exports from React Router:deferAbortedDeferredErrortype TypedDeferredDataUNSAFE_DeferredDataUNSAFE_DEFERRED_SYMBOL,
- Breaking
Collapse
@remix-run/routerintoreact-routerCollapse
react-router-domintoreact-routerCollapse
@remix-run/server-runtimeintoreact-routerCollapse
@remix-run/testingintoreact-router
- Breaking
Remove single fetch future flag.
- Breaking
Drop support for Node 16, React Router SSR now requires Node 18 or higher
- Breaking
Remove
future.v7_startTransitionflag - Breaking
Expose the underlying router promises from the following APIs for compsition in React 19 APIs:
useNavigate()useSubmituseFetcher().loaduseFetcher().submituseRevalidator.revalidate
- Breaking
Remove
future.v7_normalizeFormMethodfuture flag - Breaking
For Remix consumers migrating to React Router, the
cryptoglobal from the Web Crypto API is now required when using cookie and session APIs. This means that the following APIs are provided fromreact-routerrather than platform-specific packages:createCookiecreateCookieSessionStoragecreateMemorySessionStoragecreateSessionStorage
For consumers running older versions of Node, the
installGlobalsfunction from@remix-run/nodehas been updated to defineglobalThis.crypto, using Node'srequire('node:crypto').webcryptoimplementation.Since platform-specific packages no longer need to implement this API, the following low-level APIs have been removed:
createCookieFactorycreateSessionStorageFactorycreateCookieSessionStorageFactorycreateMemorySessionStorageFactory
- Breaking
Imports/Exports cleanup
Removed the following exports that were previously public API from
@remix-run/routertypes
AgnosticDataIndexRouteObjectAgnosticDataNonIndexRouteObjectAgnosticDataRouteMatchAgnosticDataRouteObjectAgnosticIndexRouteObjectAgnosticNonIndexRouteObjectAgnosticRouteMatchAgnosticRouteObjectTrackedPromiseunstable_AgnosticPatchRoutesOnMissFunctionAction-> exported asNavigationTypeviareact-routerRouterexported asDataRouterto differentiate from RR's<Router>
API
getToPathname(@private)joinPaths(@private)normalizePathname(@private)resolveTo(@private)stripBasename(@private)createBrowserHistory-> in favor ofcreateBrowserRoutercreateHashHistory-> in favor ofcreateHashRoutercreateMemoryHistory-> in favor ofcreateMemoryRoutercreateRoutercreateStaticHandler-> in favor of wrappercreateStaticHandlerin RR DomgetStaticContextFromError
Removed the following exports that were previously public API from
react-routerHashPathnameSearch
- Breaking
Update minimum node version to 18
- Breaking
Remove
future.v7_prependBasenamefrom the ionternalized@remix-run/routerpackage - Breaking
Migrate Remix type generics to React Router
These generics are provided for Remix v2 migration purposes
These generics and the APIs they exist on should be considered informally deprecated in favor of the new
Route.*typesAnyone migrating from React Router v6 should probably not leverage these new generics and should migrate straight to the
Route.*typesFor React Router v6 users, these generics are new and should not impact your app, with one exception
useFetcherpreviously had an optional generic (used primarily by Remix v2) that expected the data typeThis has been updated in v7 to expect the type of the function that generates the data (i.e.,
typeof loader/typeof action)Therefore, you should update your usages:
❌
useFetcher<LoaderData>()✅
useFetcher<typeof loader>()
- Breaking
Remove
future.v7_throwAbortReasonfrom internalized@remix-run/routerpackage - Breaking
Add
exportsfield to all packages - Breaking
Node package no longer re-exports from react-router
- Breaking
Renamed RemixContext to FrameworkContext
- Breaking
Updates the minimum React version to 18
- Breaking
PrefetchPageDescriptor replaced by PageLinkDescriptor
- Breaking
Consolidate types previously duplicated across
@remix-run/router,@remix-run/server-runtime, and@remix-run/reactnow that they all live inreact-routerExamples:
LoaderFunction,LoaderFunctionArgs,ActionFunction,ActionFunctionArgs,DataFunctionArgs,RouteManifest,LinksFunction,Route,EntryRouteThe
RouteManifesttype used by the "remix" code is now slightly stricter because it is using the former@remix-run/routerRouteManifestRecord<string, Route> -> Record<string, Route | undefined>
Removed
AppDatatype in favor of inliningunknownin the few locations it was usedRemoved
ServerRuntimeMeta*types in favor of theMeta*types they were duplicated from
- Breaking
Remove the
future.v7_partialHydrationflagThis also removes the
<RouterProvider fallbackElement>propTo migrate, move the
fallbackElementto ahydrateFallbackElement/HydrateFallbackon your root route
Also worth nothing there is a related breaking changer with this future flag:
Without
future.v7_partialHydration(when usingfallbackElement),state.navigationwas populated during the initial loadWith
future.v7_partialHydration,state.navigationremains in an"idle"state during the initial load
- Breaking
Remove
v7_relativeSplatPathfuture flag - Breaking
Drop support for Node 18, update minimum Node vestion to 20
Remove
installGlobals()as this should no longer be necessary
- Breaking
Remove remaining future flags
React Router
v7_skipActionErrorRevalidationRemix
v3_fetcherPersist,v3_relativeSplatPath,v3_throwAbortReason
- Breaking
Rename createRemixStub to createRoutesStub
- Breaking
Remove
@remix-run/routerdeprecateddetectErrorBoundaryoption in favor ofmapRouteProperties - Breaking
Add
react-router/domsubpath export to properly enablereact-domas an optionalpeerDependencyThis ensures that we don't blindly
import ReactDOM from "react-dom"in<RouterProvider>in order to accessReactDOM.flushSync(), since that would breakcreateMemoryRouteruse cases in non-DOM environmentsDOM environments should import from
react-router/domto get the proper component that makesReactDOM.flushSync()available:If you are using the Vite plugin, use this in your
entry.client.tsx:import { HydratedRouter } from 'react-router/dom'
If you are not using the Vite plugin and are manually calling
createBrowserRouter/createHashRouter:import { RouterProvider } from "react-router/dom"
- Breaking
Remove
future.v7_fetcherPersistflag - Breaking
Update
cookiedependency to^1.0.1- please see the release notes for any breaking changes
Minor Changes
Add support for
prerenderconfig in the React Router vite plugin, to support existing SSG use-casesYou can use the
prerenderconfig to pre-render your.htmland.datafiles at build time and then serve them statically at runtime (either from a running server or a CDN)prerendercan either be an array of string paths, or a function (sync or async) that returns an array of strings so that you can dynamically generate the paths by talking to your CMS, etc.
// react-router.config.ts import type { Config } from "@react-router/dev/config"; export default { async prerender() { let slugs = await fakeGetSlugsFromCms(); // Prerender these paths into `.html` files at build time, and `.data` // files if they have loaders return ["/", "/about", ...slugs.map((slug) => `/product/${slug}`)]; }, } satisfies Config; async function fakeGetSlugsFromCms() { await new Promise((r) => setTimeout(r, 1000)); return ["shirt", "hat"]; }Params, loader data, and action data as props for route component exports
export default function Component({ params, loaderData, actionData }) {} export function HydrateFallback({ params }) {} export function ErrorBoundary({ params, loaderData, actionData }) {}Remove duplicate
RouterProviderimpliementationsTypesafety improvements
React Router now generates types for each of your route modules.
You can access those types by importing them from./+types.<route filename without extension>.
For example:// app/routes/product.tsx import type * as Route from "./+types.product"; export function loader({ params }: Route.LoaderArgs) {} export default function Component({ loaderData }: Route.ComponentProps) {}This initial implementation targets type inference for:
Params: Path parameters from your routing config inroutes.tsincluding file-based routingLoaderData: Loader data fromloaderand/orclientLoaderwithin your route moduleActionData: Action data fromactionand/orclientActionwithin your route module
In the future, we plan to add types for the rest of the route module exports:
meta,links,headers,shouldRevalidate, etc.
We also plan to generate types for typesafeLinks:<Link to="/products/:id" params={{ id: 1 }} /> // ^^^^^^^^^^^^^ ^^^^^^^^^ // typesafe `to` and `params` based on the available routes in your appCheck out our docs for more:
Stabilize
unstable_dataStrategyStabilize
unstable_patchRoutesOnNavigation
Patch Changes
No changes
Remove unstable upload handler.
Remove unneeded dependency on @web3-storage/multipart-parser
Fix redirects returned from loaders/actions using
data()react-router: (v7) fix static prerender of non-ascii characters
Replace
substrwithsubstring- Removed
Remove the deprecated
jsonutilityYou can use
Response.jsonif you still need to construct JSON responses in your app
Remove unneeded dependency on source-map
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.