react-router
8.5.1 · 27 Oct 2026MIT80.5M / weekRepositorynpmAtom feed
Upgrading react-router From 6.8.2 to 7.18.0
95 releases in betweennotes for 89
Reading releases, release notes and advisories…
Counted from 89 of 95 release notes. Advisories are counted from the advisory database, in full.
Before you upgrade
Tick each one off as you go- Breaking7.15.0
- Breaking7.15.0
- Breaking7.14.0
- Breaking7.10.0
- Breaking7.9.6
- Breaking7.8.0
- Breaking7.8.0
- Breaking7.8.0
- Breaking7.5.0
- Breaking7.4.1
Security
1 advisory still affects 7.18.0
- React Router: RSC Mode CSRF Bypass Allows Action Execution Before 400 Responsehigh · GHSA-qwww-vcr4-c8h2
Upgrading to 7.18.2 clears it.
Fixes 4 advisories affecting 6.8.2
- React Router's same-origin redirect with path starting // causes open redirect via protocol-relative URL reinterpretationmoderate · GHSA-2j2x-hqr9-3h42
- React Router: Arbitrary Constructor Injection via deserializeErrors() in React Router SSR Hydrationmoderate · GHSA-337j-9hxr-rhxg
- React Router has unexpected external redirect via untrusted pathsmoderate · GHSA-9jcx-v3wj-wh4m
- React Router: Open redirect via backslash in <Link> and useNavigate (CVE-2025-68470 bypass)moderate · GHSA-wrjc-x8rr-h8h6
- 7.12.0
Add additional layer of CSRF protection by rejecting submissions to UI routes from external origins. If you need to permit access to specific external origins, you can specify them in the
react-router.config.tsconfigallowedActionOriginsfield. - 6.30.3
Release by release
- Fixed
Fix server handler prerender responses when using
ssr: falseandfuture.v8_trailingSlashAwareDataRequests: true. Avoids false positive "SPA Mode" detection when serving prerendered paths - Fixed
Use the
ServerRouternonce for nonce-aware SSR components when they don't provide their own value so strict CSP pages can load them. - Fixed
Use
turbo-streamto serialize and deserialize Framework Mode hydration errors - Fixed
Precompute route branch matchers to avoid recompiling route path regexes during matching
- Fixed
- New
Ship a subset of the official documentation inside the
react-routerpackage
- New
- New
Stabilize
future.unstable_trailingSlashAwareDataRequestsasfuture.v8_trailingSlashAwareDataRequests - Fixed
Disable manifest path when lazy route dicovery is disabled
- Fixed
Fix browser URL creation to use the configured history window instead of the global window.
- Fixed
Fix
useNavigation()return type to preserve discriminated union across navigation states - Fixed
Widen
MetaDescriptorscript:ld+jsontype fromLdJsonObjecttoLdJsonObject | LdJsonObjectto permit multiple JSON-LD schemas in a single<script type="application/ld+json">tag emitted by<Meta />
- New
- New
Add a new
unstable_useRouterState()hook that consolidates access to active and pending router states (RFC: #12358) - Fixed
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.
- Fixed
Fix
serverLoader()returning stale SSR data when a client navigation aborts pending hydration before the hydrationclientLoaderresolves - Fixed
Fix
RouterProvideronErrorcallback not being called for synchronous initial loader errors in SPA mode - Fixed
Memoize
useFetchersto return a stable identity and only change if fetchers changed - Fixed
Internal refactor to consolidate mutation request detection through shared utility
- New
- Breaking
⚠️ This is a breaking change if you have already opted into the unstable version - you will need to update your code accordingly
- Breaking
Remove
unstable_subResourceIntegrityfrom the runtimeFutureConfigtype; the flag is now controlled by the top-levelsubResourceIntegrityoption inreact-router.config.ts - New
Stabilize
unstable_defaultShouldRevalidateasdefaultShouldRevalidateon<Link>,<Form>,useLinkClickHandler,useSubmit,fetcher.submit, andsetSearchParams - New
Stabilize the instrumentation APIs.
unstable_instrumentationsis nowinstrumentationsandunstable_patternis nowpattern
- Breaking
- Fixed
Fix a potential race condition that can occur when rendering a
HydrateFallbackand initial loaders land before therouter.subscribecall happens in theRouterProviderlayout effect - Fixed
Normalize double-slashes in redirect paths
- Fixed
- Breaking
UNSTABLE RSC FRAMEWORK MODE BREAKING CHANGE - Existing route module exports remain unchanged from stable v7 non-RSC mode, but new exports are added for RSC mode. If you want to use RSC features, you will need to update your route modules to export the new annotations.
- Fixed
Rsc Link prefetch
- Fixed
Remove recursion from turbo-stream v2 allowing for encoding / decoding of massive payloads.
- Fixed
encodeViaTurboStream leaked memory via unremoved AbortSignal listener
- Breaking
22 other lines we could not sort, mostly version bumps
- 7.10.0
The
match.shouldLoadAPI is now marked deprecated in favor of these more powerful alternatives - 7.10.0
If you're using this API in a custom
dataStrategytoday, you can swap to the new API at your convenience: - 7.10.0
match.shouldRevalidateArgsis the argument that will be passed to the routeshouldRevaliatefunction - 7.10.0
Combined with the parameter accepted by
match.shouldCallHandler, you can define a custom revalidation behavior for yourdataStrategy: - 7.2.0
A parent route has only a
loader(does not have aclientLoader) - 7.2.0
The parent route is pre-rendered
- 7.2.0
The parent route has children routes which are not prerendered
- 7.2.0
This means that when the child paths are loaded via the SPA fallback, the parent won't have any
loaderDatabecause there is no server on which to run theloader - 7.2.0
This can be resolved by either adding a parent
clientLoaderor pre-rendering the child paths - 7.2.0
If you add a
clientLoader, calling theserverLoader()on non-prerendered paths will throw a 404
42 internal lines (docs, tests, tooling) left out.
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.