react-router
8.5.1 · 27 Oct 2026MIT80.5M / weekRepositorynpmAtom feed
7.18.6 is the newest release of 7.x.
In short
1 new5 fixed
Security
Fixes 1 advisory that affected 7.15.0
- LowReact Router: Potential CSRF via PUT/PATCH/DELETE document requestsGHSA-84g9-w2xq-vcv6 · 15 Jun 2026Fixed in 7.15.1
5 advisories affect 7.15.1; 7.18.2 fixes them
- HighReact Router: RSC Mode CSRF Bypass Allows Action Execution Before 400 ResponseGHSA-qwww-vcr4-c8h2 · 24 Jul 2026Fixed in 7.18.2
- HighReact Router: Unauthenticated Denial of Service via Inefficient Route MatchingGHSA-chx6-hx7r-mcp5 · 24 Jul 2026Fixed in 7.18.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: RSCErrorHandler Missing Protocol Validation (XSS)GHSA-h8fp-f39c-q6mh · 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
Release note
The section about react-router of a note shared by several packages.
Patch Changes
Update router to operate on fetcher Maps in an immutable manner to avoid delayed React renders from potentially reading an updated but not yet committed Map. This could result in brief flickers in some fetcher-driven optimistic UI scenarios.
Fix
serverLoader()returning stale SSR data when a client navigation aborts pending hydration before the hydrationclientLoaderresolvesFix
RouterProvideronErrorcallback not being called for synchronous initial loader errors in SPA modeMemoize
useFetchersto return a stable identity and only change if fetchers changedInternal refactor to consolidate mutation request detection through shared utility
Unstable Changes
⚠️ Unstable features are not recommended for production use
Add a new
unstable_useRouterState()hook that consolidates access to active and pending router states (RFC: #12358)Data/Framework/RSC only — throws when used without a data router
This should allow you to consolidate usages of the following hooks which will likely be deprecated and removed in a future major version
useLocationuseSearchParamsuseParamsuseMatchesuseNavigationTypeuseNavigation
let { active, pending } = unstable_useRouterState(); // Active is always populated with the current location active.location; // replaces `useLocation()` active.searchParams; // replaces `useSearchParams()[0]` active.params; // replaces `useParams()` active.matches; // replaces `useMatches()` active.type; // replaces `useNavigationType()` // Pending is only populated during a navigation pending.location; // replaces `useNavigation().location` pending.searchParams; // equivalent to `new URLSearchParams(useNavigation().search)` pending.params; // Not directly accessible today pending.matches; // Not directly accessible today pending.type; // Not directly accessible today pending.state; // replaces `useNavigation().state` pending.formMethod; // replaces useNavigation().formMethod pending.formAction; // replaces useNavigation().formAction pending.formEncType; // replaces useNavigation().formEncType pending.formData; // replaces useNavigation().formData pending.json; // replaces useNavigation().json pending.text; // replaces useNavigation().text
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.