react-router
8.5.1 · 27 Oct 2026MIT80.5M / weekRepositorynpmAtom feed
7.18.6 is the newest release of 7.x.
In short
1 breaking1 new1 faster6 fixed4 changed
- Breaking
⚠️ This is a breaking change if you have begun using
fetcher.unstable_reset()
Security
13 advisories affect 7.10.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 in unstable RSC redirect handling via javascript: redirect targetsGHSA-8646-j5j9-6r62 · 3 Jun 2026Fixed in 7.13.2
8 more
- HighReact Router vulnerable to XSS via Open RedirectsGHSA-2w69-qvjg-hvjx · 8 Jan 2026Fixed in 7.12.0
- HighReact Router SSR XSS in ScrollRestorationGHSA-8v8x-cx79-35w7 · 8 Jan 2026Fixed in 7.12.0
- 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: Open redirect leading to XSSGHSA-jjmj-jmhj-qwj2 · 23 Jul 2026Fixed in 7.13.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 stored XSS via unescaped Location header in prerendered redirect HTMLGHSA-f22v-gfqf-p8f3 · 3 Jun 2026Fixed in 7.13.2
- ModerateReact Router has CSRF issue in Action/Server Action Request ProcessingGHSA-h5cw-625j-3rxh · 8 Jan 2026Fixed in 7.12.0
Release note
The section about react-router of a note shared by several packages.
Minor Changes
Stabilize
fetcher.reset()⚠️ This is a breaking change if you have begun using
fetcher.unstable_reset()
Stabilize the
dataStrategymatch.shouldRevalidateArgs/match.shouldCallHandler()APIs.The
match.shouldLoadAPI is now marked deprecated in favor of these more powerful alternativesIf you're using this API in a custom
dataStrategytoday, you can swap to the new API at your convenience:// Before const matchesToLoad = matches.filter((m) => m.shouldLoad); // After const matchesToLoad = matches.filter((m) => m.shouldCallHandler());
match.shouldRevalidateArgsis the argument that will be passed to the routeshouldRevaliatefunctionCombined with the parameter accepted by
match.shouldCallHandler, you can define a custom revalidation behavior for yourdataStrategy:
const matchesToLoad = matches.filter((m) => { const defaultShouldRevalidate = customRevalidationBehavior( match.shouldRevalidateArgs, ); return m.shouldCallHandler(defaultShouldRevalidate); // The argument here will override the internal `defaultShouldRevalidate` value });
Patch Changes
Fix a Framework Mode bug where the
defaultShouldRevalidateparameter toshouldRevalidatewould not be correct afteractionreturned a 4xx/5xx response (truewhen it should have beenfalse)If your
shouldRevalidatefunction relied on that parameter, you may have seen unintended revalidations
Fix
fetcher.submitfailing with plain objects containing atagNameproperty[UNSTABLE] Add
unstable_patternto the parameters for client sideunstable_onError, refactor how it's called byRouterProviderto avoid potential strict mode issuesAdd new
unstable_useTransitionsflag to routers to give users control over the usage ofReact.startTransitionandReact.useOptimistic.Framework Mode + Data Mode:
<HydratedRouter unstable_transition>/<RouterProvider unstable_transition>When left unset (current default behavior)
Router state updates are wrapped in
React.startTransition⚠️ This can lead to buggy behaviors if you are wrapping your own navigations/fetchers in
React.startTransitionYou should set the flag to
trueif you run into this scenario to get the enhanceduseOptimisticbehavior (requires React 19)
When set to
trueRouter state updates remain wrapped in
React.startTransition(as they are without the flag)Link/Formnavigations will be wrapped inReact.startTransitionA subset of router state info will be surfaced to the UI during navigations via
React.useOptimistic(i.e.,useNavigation(),useFetchers(), etc.)⚠️ This is a React 19 API so you must also be React 19 to opt into this flag for Framework/Data Mode
When set to
falseThe router will not leverage
React.startTransitionorReact.useOptimisticon any navigations or state changes
Declarative Mode
<BrowserRouter unstable_useTransitions>When left unset
Router state updates are wrapped in
React.startTransition
When set to
trueRouter state updates remain wrapped in
React.startTransition(as they are without the flag)Link/Formnavigations will be wrapped inReact.startTransition
When set to
falsethe router will not leverage
React.startTransitionon any navigations or state changes
Fix the promise returned from
useNavigatein Framework/Data Mode so that it properly tracks the duration ofpopstatenavigations (i.e.,navigate(-1))Fix internal type error in useRoute types that surfaces when skipLibCheck is disabled
Preserve
statusTexton theErrorResponseinstance when throwingdata()from a route handlerOptimize href() to avoid backtracking regex on splat
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.