npm / react-router-dom
react-router-dom
What changed in react-router-dom 7, from its official release notes, upgrade guides and advisories. Also covers @types/react-router-dom. Sources checked 2026-10-18.
6 breaking7 new APIs and options
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initreact-router-dom 713 changes
Breaking changes 6
The React Router Cloudflare dev proxy is removed; Cloudflare projects should use @cloudflare/vite-plugin instead.
Use loaderData instead of deprecated data fields in meta arguments, meta matches, and matches returned from useMatches().
React Router v8 requires node@22.22+.
React Router v8 requires react@19.2.7+ and react-dom@19.2.7+.
The re-export package is removed; import DOM-specific APIs from react-router/dom and other APIs from react-router.
Framework mode requires vite@7+ and the future.v8_viteEnvironmentApi flag.
New APIs and options 7
Opt in to middleware that runs code before and after Response generation for a matched path.
Pass the raw HTTP request to handlers instead of normalizing request.url; use the sibling url parameter for normalized routing logic.
Opt in to splitting client-side route exports into independently loadable chunks, so they can run while the route component downloads.
Preserve trailing-slash semantics in data request URLs using the /_.data format for trailing-slash routes; the root data request changes to /_.data.
Enable support for Vite's experimental Environment API; custom configuration relying on isSsrBuild may need to move under per-environment configuration.
A sibling handler parameter provides a URL instance representing the normalized location when request.url is passed through raw.
The Architect adapter will use event.requestContext.domainName by default, falling back to the Host header; this option can opt in to that behavior on v7.