react-router
8.5.1 · 27 Oct 2026MIT80.5M / weekRepositorynpmAtom feed
8.5.2 is the newest release of 8.x.
In short
10 breaking1 new5 fixed
- Breaking
Remove the
future.v8_trailingSlashAwareDataRequestsflag - Breaking
Update
tsconfig.jsontarget/libfromES2020 -> ES2022 - Breaking
Switch the published packages in
packages/to ESM-only. - Breaking
Remove deprecated
dataparameter in favor ofloaderDataformetaAPIs (to align withRoute.ComponentProps) - Breaking
Remove
future.v8_passThroughRequestsflag - the raw incomingrequestis now always passed through toloader/action. Useurlfor the normalized URL without React Router-specific implementation details (.datasuffixes,index/_routessearch params). - Breaking
Remove internal
hasErrorBoundaryfield added torouter.routeswhen using a data router - Breaking
Remove
react-router-dompackage - Breaking
Remove
future.v8_middlewareflag — middleware is always enabled in v8
Security
1 advisory affects 8.0.0; 8.3.0 fixes them
- HighReact Router: RSC Mode CSRF Bypass Allows Action Execution Before 400 ResponseGHSA-qwww-vcr4-c8h2 · 24 Jul 2026Fixed in 8.3.0
Release note
The section about react-router of a note shared by several packages.
Major Changes
- Breaking
Remove the
future.v8_trailingSlashAwareDataRequestsflagTrailing slash-aware data request URLs are now the default behavior.
- Breaking
Update
tsconfig.jsontarget/libfromES2020 -> ES2022 - Breaking
Switch the published packages in
packages/to ESM-only. - Breaking
Remove deprecated
dataparameter in favor ofloaderDataformetaAPIs (to align withRoute.ComponentProps)Route.MetaArgs,Route.MetaMatch,MetaArgs,MetaMatch,Route.ComponentProps.matches,UIMatch
- Breaking
Remove
future.v8_passThroughRequestsflag - the raw incomingrequestis now always passed through toloader/action. Useurlfor the normalized URL without React Router-specific implementation details (.datasuffixes,index/_routessearch params). - Breaking
Remove internal
hasErrorBoundaryfield added torouter.routeswhen using a data routerThis should not impact user-facing code since this was an internal prop and was computed based on the presence of
ErrorBoundaryorerrorElementon your routehasErrorBoundaryis no longer accepted onRouteObject(IndexRouteObject/NonIndexRouteObject),DataRouteObject,<Route>JSX props, or as a key inlazyroute definitions.The
MapRoutePropertiesFunctionsignature no longer requires returninghasErrorBoundary; the router infers it directly.
- Breaking
Remove
react-router-dompackageIn v7 everything DOM-specific was collapsed into
react-router/domreact-router-domwas kept around as a convenience so existing v6 app imports would still work
For v8, you will need to swap
react-router-domimports:RouterProvider/HydratedRoutershould be imported fromreact-router/domEverything else should be imported from
react-router
- Breaking
Remove
future.v8_middlewareflag — middleware is always enabled in v8The
future.v8_middlewareflag has been removed; middleware is now always enabledThe
contextparameter passed toloader,action, andmiddlewarefunctions is always aRouterContextProviderinstancegetLoadContextfunctions in custom servers must return aRouterContextProvider— returning a plain object is no longer supportedThe
MiddlewareEnabledtype (previously exported asUNSAFE_MiddlewareEnabled) has been removed since the conditional it gated is now unconditionalThe
Futuremodule augmentation pattern (interface Future { v8_middleware: true }) is no longer needed to typecontextin Data Mode
- Breaking
Update minimum Node version to 22.22.0
- Breaking
Update minimum React version to 19.2.7
Minor Changes
Bump dependencies
Bumped
cookiefrom^1.0.1to^1.1.1Bumped
set-cookie-parserfrom^2.6.0to^3.1.0
Patch Changes
Ensure client middleware errors load lazy route error boundaries before bubbling
Remove explicit
onSubmittype override fromSharedFormPropsto fix deprecation warning with@types/react@19.xUpdate package builds to preserve individual module files in published artifacts. Public APIs and documented import paths are unchanged.
Updated package TypeScript configs to support modern module syntax used by the build configuration.
Migrate package builds from
tsuptotsdown. Published package entry points and public APIs are unchanged.Upgrade React Router's TypeScript tooling to TypeScript 6. Runtime behavior and public APIs are unchanged.
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.