react-router
8.5.1 · 27 Oct 2026MIT80.5M / weekRepositorynpmAtom feed
8.5.2 is the newest release of 8.x.
In short
1 deprecated3 new8 fixed1 changed
- Deprecated
Deprecate React Router's view transition APIs in favor of React's
<ViewTransition>component, available in React 19.3 and later
Release note
The section about react-router of a note shared by several packages.
Minor Changes
- Deprecated
Deprecate React Router's view transition APIs in favor of React's
<ViewTransition>component, available in React 19.3 and laterDeprecate the
viewTransitionprops/options,useViewTransitionState, andNavLink'sisTransitioningrender prop andtransitioningclassPreserve existing behavior, including support for older React versions
See the migration guide for a navigation example and compatibility considerations
Patch Changes
Fix
<Await>failing to server render promises decoded from an RSC payload, which caused the Suspense boundary to switch to client renderingDeclare
@types/reactand@types/react-domas optional peer dependencies so the shipped type definitions resolve React types under strict (non-hoisted) node_modules layoutsFix the
unstable_useRouterStatedocumentation example to call the imported aliasRender the
HydrateFallbackof a route discovered throughpatchRoutesOnNavigationduring initial hydrationRoutes discovered during initial hydration are now exposed in
state.matcheswhile their loaders run, so<RouterProvider>renders down to the discovered route'sHydrateFallbackinstead of rendering nothing
Fix router state recovery when updates occur before
RouterProvidersubscribes, including when other subscribers are already attached, and report current client errors once without replaying server errors during hydrationFix
matchPathnot treating a static segment as optional when it contains characters outside[\w-]Fix an RSC server crash when a client aborts a document request while the HTML stream waits for the RSC payload
Stop revalidating a fetcher after
fetcher.reset(), so its cleared data no longer comes back on the next revalidation
Unstable Changes
⚠️ Unstable features are not recommended for production use
Add an
unstable_fetchprop to<HydratedRouter>to customize JavaScript-issued manifest and server data requests in conventional Framework ModeThe function receives the intended request as well as context identifying the type of request
Data request context includes
navigationType("PUSH","REPLACE", or"POP"for navigation-initiated requests, including reloaded fetchers;nullotherwise)Data strategies receive equivalent metadata through
unstable_initiatorandunstable_navigationType
The custom fetch context is a discriminated union, so narrowing
typeto"navigation"guarantees a non-nullnavigationType, while other data requests have anullnavigationTypeFetchers reloaded after an initialization redirect retain the
"initialization"type and include their fetcher key
Like other router initialization options, the implementation is captured when the singleton router is created and thus subsequent prop changes are ignored
Browser-managed data prefetches from
<Link prefetch>use native<link rel="prefetch">elements and do not call the custom implementationUse the callback for custom fetch options, custom headers, safe request retries, or response header inspection
Return response bodies unchanged so React Router can decode its manifest and Turbo Stream data protocols
Support API-only Framework Mode with runtime server data loading, actions, revalidation, and lazy route discovery
Hydrate prerendered pages from build-time data and fetch server loader data when hydrating a SPA fallback
Preserve normal loader revalidation and server-action support for eagerly loaded and lazily discovered routes, and honor loader opt-outs when making server data requests
Add
unstable_useRouteDiscoveryfor application-controlled route discovery in conventional Framework ModeDiscover selected destinations or load the running client's full route manifest without loading route modules
Compose manifest-mismatch handlers, with shared recovery and cancellation that preserves application state
Keep full-manifest failures catchable without rendering error boundaries, whether mismatch handlers use the hook or event's
loadAllRoutes()Cancel pending revalidation alongside a canceled navigation, retaining existing data and settling interrupted fetchers before restoring Back/Forward history
Enable
future.unstable_customRouteDiscoveryto opt inApps without the flag retain existing discovery behavior
Call
event.defaultBehavior()from a custom mismatch handler to explicitly run built-in recovery
Return middleware short-circuit responses as-is for document requests in RSC modes, including resource routes, instead of decoding non-RSC bodies as Flight
Include server middleware in both eager and lazy RSC route configuration types
Preserve HTML rendering for cached Flight responses returned by middleware, and pass through raw responses that replace the result of
next()
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.