unstale

npm / react-router

react-router

What changed in react-router 5 to 8, from its official release notes, upgrade guides and advisories. Also covers @types/react-router. Sources checked 2026-11-30.

97 breaking31 security10 deprecations62 new APIs and options6 performance37 behavior and defaults16 tooling93 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli on npm

react-router 8102 changes

Breaking changes 22

  • Internal router contexts are more granular, changing exported unsafe contexts; users of those exports should review the breaking changes.

    8.4.0release notes

  • Components using hooks for only some router state no longer re-render for unrelated state changes; for example, useLocation alone does not re-render when navigation.state transitions to loading.

    8.4.0release notes

  • Path parameters are encoded using RFC 3986 path-segment rules, leaving valid pchar characters such as + unescaped.

    8.3.0release notes

  • Removed the obsolete type export; middleware is always enabled and server request context is provided through RouterContextProvider.

    8.0.1release notes

  • Published packages are ESM-only, so consumers must use an ESM-compatible setup.

    8.0.0release notes

  • The flag was removed because Vite Environment API prerendering is now the default.

    8.0.0release notes

  • The future flag was removed because raw incoming requests are now passed to loaders and actions; use url for the normalized URL.

    8.0.0release notes

  • Custom server getLoadContext functions must return a RouterContextProvider; returning a plain object is no longer supported.

    8.0.0release notes

  • The internal route field is no longer added to data-router routes or accepted in route objects, JSX props, or lazy route definitions; the router infers it.

    8.0.0release notes

  • create-react-router now uses native fetch, removing the underlying proxy support previously provided by node-fetch and @remix-run/web-fetch.

    8.0.0release notes

  • Use loaderData instead of deprecated data fields in meta arguments, matched route data, and useMatches() results.

    7.0.0, 8.0.0upgrade guiderelease notes

  • Middleware is always enabled in v8, and the context parameter for loaders, actions, and middleware is always a RouterContextProvider instance.

    8.0.0release notes

  • The MiddlewareEnabled type, previously exported as UNSAFE_MiddlewareEnabled, was removed because middleware is unconditional.

    8.0.0release notes

  • The minimum supported Node version is now 22.22.0.

    8.0.0release notes

  • Prerendering with the Vite Environment API is now the default, replacing the old pre-rendering implementation with the preview server flow.

    8.0.0release notes

  • The minimum supported React version is now 19.2.7.

    8.0.0release notes

  • The Cloudflare dev proxy export was removed; Cloudflare projects should use @cloudflare/vite-plugin instead.

    8.0.0release notes

  • The re-export package is removed in v8; import general APIs from react-router and DOM-specific APIs from react-router/dom.

    7.0.0, 8.0.0upgrade guiderelease notesupgrade guide

  • Trailing slash-aware data request URLs are now the default behavior; the corresponding future flag was removed.

    8.0.0release notes

  • The createRequestHandler option was removed because its behavior is now the default.

    8.0.0release notes

  • React Router now requires Vite 7 or later.

    8.0.0release notes

  • The Vite Environment API is always enabled, and its build path is mandatory.

    8.0.0release notes

Security 7

  • Streamed RSC redirect locations are correctly escaped in meta tag attributes.

    7.18.4, 8.4.0release notesrelease notes

  • Treat every Server Function as a public endpoint that must perform its own access-control checks; route actions are recommended when route middleware should provide access control.

    8.4.0release notes

  • Improves validation of action request origins.

    7.18.3, 8.3.1release notesrelease notes

  • Adds additional URL validation on client-side navigations and redirects.

    7.18.3, 8.3.1release notesrelease notes

  • React Router: RSC Mode CSRF Bypass Allows Action Execution Before 400 Response

    7.18.2, 8.3.0security advisoryrelease notes

  • Unstable RSC CSRF code paths are hardened.

    8.3.0release notes

  • A virtual module provides integrity hashes for custom RSC SSR entries to pass through React's importMap render option.

    8.3.0release notes

Deprecations 6

  • The isTransitioning render prop is deprecated in favor of React’s View Transition classes.

    8.5.0release notes

  • The transitioning class is deprecated in favor of React’s View Transition classes.

    8.5.0release notes

  • Deprecated in favor of React’s <ViewTransition> component; the existing API continues to work during React Router v8 and will be removed in v9.

    8.5.0release notes

  • The viewTransition props/options are deprecated in favor of React’s <ViewTransition> component and will be removed in React Router v9.

    8.5.0release notes

  • The branches option is deprecated and ignored because createStaticRouter caches route branches internally; EntryContext.branches remains available but is always empty.

    8.4.0release notes

  • Deprecates the flag ahead of its removal in React Router v9.

    8.3.1release notes

New APIs and options 24

  • The route discovery hook exposes discoverRoutes(paths) to load route metadata without navigating or loading route modules.

    8.5.0release notes

  • A custom manifest-mismatch handler can call event.defaultBehavior() to explicitly run built-in recovery.

    8.5.0release notes

  • Enable application-controlled route discovery in conventional Framework Mode while retaining automatic discovery unless a custom mismatch handler is provided.

    8.5.0release notes

  • The route discovery hook exposes loadAllRoutes() to load the running client's full route manifest.

    8.5.0release notes

  • The route discovery hook exposes shared discovery state with partial, loading, or complete values.

    8.5.0release notes

  • Configure the origin for API-only loader, action, and route discovery requests when the API server runs on a separate origin.

    8.5.0release notes

  • Pass a callback to HydratedRouter to customize JavaScript-issued manifest and server data requests; the callback receives the request and request-type context.

    8.5.0release notes

  • Data strategies receive request-type metadata equivalent to the custom fetch context.

    8.5.0release notes

  • Data strategies receive navigation type metadata, including PUSH, REPLACE, or POP for navigation-initiated data requests.

    8.5.0release notes

  • Discover selected destinations or load the running client's complete route manifest without loading route modules or navigating.

    8.5.0release notes

  • Data Mode can opt into a more efficient route matcher powered by @remix-run/route-pattern; preload the matcher before enabling the flag.

    8.4.0release notes

  • Use the opted-in router's match API when matching with the new route matcher; the API is private and unstable until the flag stabilizes.

    8.4.0release notes

  • Preloads the new route matcher before enabling the route-pattern matching flag, so applications that do not opt in avoid downloading the matcher.

    8.4.0release notes

  • Route definitions can provide keyed regular expressions to reject invalid parameter values and continue matching later routes; absent optional parameters are not validated.

    8.4.0release notes

  • The subResourceIntegrity config option is supported in RSC Framework Mode.

    8.3.0release notes

  • Custom RSC entry.rsc.tsx files should pass the generated client version so stale RSC clients can be detected during lazy route discovery and the destination document reloaded.

    8.3.0release notes

  • RSC document rendering accepts a nonce that is forwarded to the HTML renderer and injected RSC payload scripts.

    8.3.0release notes

  • RSC document rendering accepts a nonce for nonce-aware framework components.

    8.3.0release notes

  • A virtual module provides the RSC client build version for custom RSC entries.

    8.3.0release notes

  • Node Framework Mode apps can opt into a default server entry using renderToReadableStream instead of renderToPipeableStream; the flag has no effect when a custom entry.server.tsx exists.

    8.2.0release notes

  • Skip copying the official React Router agent skill into a generated project.

    8.1.0release notes

  • Instrumentation results for server requests, client navigations, and client fetches now include URL, matched route pattern, and params metadata.

    8.1.0release notes

  • Server request handler instrumentation results now expose known HTTP status codes.

    8.1.0release notes

  • The option replaces future.v8_splitRouteModules and defaults to true; set it to false to keep route modules in one chunk or to "enforce" to require splittable routes.

    8.0.0release notes

Performance 2

  • Improves route matching performance for long paths.

    7.18.3, 8.3.1release notesrelease notes

  • In unstable RSC apps, rendered route component metadata is preserved so routes with a clientLoader can skip unnecessary server requests while still fetching missing server-rendered elements.

    8.3.0release notes

Behavior and default changes 5

  • Framework Mode can serve static HTML while retaining a runtime server for loaders, actions, revalidation, and lazy route discovery.

    8.5.0release notes

  • Serves /.well-known/* files from the client build directory while keeping other dotfiles hidden.

    8.3.1release notes

  • Non-Node Framework Mode apps use a default server entry based on renderToReadableStream, so they no longer need a custom entry.server.tsx solely to use Web Streams.

    8.2.0release notes

  • Framework mode apps add the node Vite server condition only when they declare a Node server adapter dependency, preventing non-Node SSR runtimes from resolving Node-specific package exports by default.

    8.1.0release notes

  • The TypeScript target is now ES2022.

    8.0.0release notes

Tooling 6

  • Declared as an optional peer dependency so shipped type definitions resolve React types under strict, non-hoisted node_modules layouts.

    8.5.0release notes

  • When not already configured, react-router dev restarts with --conditions=development.

    8.3.0release notes

  • TypeScript 7 can be used with the listed React Router packages and adapters.

    8.3.0release notes

  • The framework dependency installer and project creator detect nub as a supported package manager.

    8.2.0release notes

  • Generated projects include the official React Router agent skill by default with --yes or in non-interactive shells; interactive runs prompt with yes as the default.

    8.1.0release notes

  • The TypeScript library setting is now ES2022.

    8.0.0release notes

Fixes and other changes 30

  • Promises decoded from an RSC payload now server render without causing the Suspense boundary to switch to client rendering.

    8.5.0release notes

  • A reset fetcher is no longer revalidated, preventing its cleared data from returning on the next revalidation.

    8.5.0release notes

  • During initial hydration, a route discovered through patchRoutesOnNavigation is exposed in state.matches so RouterProvider renders its HydrateFallback while loaders run.

    8.5.0release notes

  • Prerender requests use the address bound by the Vite preview server and avoid re-resolving localhost to a different address family.

    8.5.0release notes

  • Request URLs no longer lose their port when the Host or X-Forwarded-Host header is an IPv6 address.

    8.5.0release notes

  • File session commits write to a temporary file and rename it into place to prevent concurrent commits from corrupting session files, while preserving existing permissions.

    8.5.0release notes

  • Document-request middleware short-circuit responses in RSC modes are returned as-is instead of decoding non-RSC bodies as Flight.

    8.5.0release notes

  • Declared as an optional peer dependency so shipped type definitions resolve React types under strict, non-hoisted node_modules layouts.

    8.5.0release notes

  • Avoids unintended view-transition calls during initial hydration and router.revalidate() calls.

    7.18.4, 8.4.0release notesrelease notes

  • Revalidation against a splat route during lazy route discovery waits for the current load's discovery, even when a fetcher key is reused, and restarts interrupted loaders after discovery completes.

    8.4.0release notes

  • SPA navigations preserve lazy route module import errors instead of replacing them with a missing dataStrategy result error.

    8.4.0release notes

  • react-router dev and vite preview use X-Forwarded-Proto when constructing request.url, fixing action submissions behind HTTPS reverse proxies; the URL host still comes from Host.

    8.4.0release notes

  • Manifest version-mismatch recovery no longer loads stale routes or repeatedly reloads; pending requests can fail so subsequent requests can recover if reload does not complete or the document is restored from back-forward cache.

    8.4.0release notes

  • The underlying decode failure is preserved as the cause of this error.

    8.4.0release notes

  • Fixes a memory leak that retained memory for the lifetime of a long-running stream while preserving error handling when a producer closes the destination.

    8.4.0release notes

  • Prevents client disconnects during streaming from crashing the Node process.

    7.18.3, 8.3.1release notesrelease notes

  • Fixes an Expected fetcher: <key> error on navigation when a fetcher is aborted during post-action revalidation.

    8.3.1release notes

  • Prevents an aborted navigation from caching a path as discovered before the route tree is patched, which could shadow the real route or cause repeated 404s.

    8.3.1release notes

  • Fixes history.scrollRestoration remaining set to auto after a bfcache restore, which could let the browser restore scroll before the destination route rendered.

    8.3.1release notes

  • Properly respects the relative option when resolving the action path.

    8.3.1release notes

  • NavLink now applies its pending state when to has a trailing slash.

    8.3.0release notes

  • Aborting a request while the RSC HTML stream has a pending flush no longer causes a server crash.

    8.3.0release notesrelease notes

  • href() now stringifies and URL-encodes parameter values to match generatePath(); splat parameters preserve path separators while encoding each segment individually.

    8.2.0release notes

  • Navigation blocker state is preserved through a revalidation.

    8.2.0release notes

  • Dynamic parameter extraction now handles routes with optional static segments, including consecutive optional segments.

    8.2.0release notes

  • ReactFormState types are used instead of unknown.

    8.2.0release notes

  • React Router detects user rolldownOptions configuration in Vite 8+.

    8.2.0release notes

  • Dynamic parameters with static extension suffixes are correctly identified and ranked, preventing them from outranking truly static routes based on definition order.

    8.2.0release notes

  • The react-router.config.ts buildEnd hook now runs after prerendering is completed.

    8.1.0release notes

  • Fixes crashes under the Bun runtime when Babel default imports are already unwrapped.

    8.1.0release notes

react-router 7222 changes

Breaking changes 64

  • Action request origins are now validated against the host in the constructed request URL instead of HTTP headers. Behind a reverse proxy, applications may need to add the internal host to allowedActionOrigins.

    7.18.0release notes

  • The unstable flag is no longer supported and causes an error during config resolution.

    7.16.0release notes

  • Stabilizes the trailing-slash-aware data requests future flag under this name.

    7.16.0release notes

  • Removes the stale, invalid unpkg field from the react-router-dom re-export package.

    7.16.0release notes

  • Moves subresource integrity configuration from the unstable FutureConfig flag to a top-level config option.

    7.15.0release notes

  • Renames unstable_defaultShouldRevalidate to defaultShouldRevalidate on Link, Form, useLinkClickHandler, useSubmit, fetcher.submit, and setSearchParams.

    7.15.0release notes

  • Renames future.unstable_passThroughRequests to future.v8_passThroughRequests in React Router and @react-router/dev.

    7.15.0release notes

  • Renames unstable_instrumentations to instrumentations and removes unstable_ prefixes from associated instrumentation types.

    7.15.0release notes

  • Stabilizes unstable_normalizePath as normalizePath on staticHandler.query and staticHandler.queryRoute.

    7.15.0release notes

  • Stabilizes unstable_pattern as pattern on loader, action, middleware, and instrumentation arguments.

    7.15.0release notes

  • Renames prerender.unstable_concurrency to prerender.concurrency.

    7.15.0release notes

  • Stabilizes the url argument on loader, action, and middleware functions, removing its unstable_ prefix.

    7.15.0release notes

  • React Router automatically serializes Error and its standard subtypes, but no longer applies undocumented custom error serialization.

    7.14.2release notes

  • Optional params no longer match paths lacking a separating slash; for example, /users/:id? no longer matches /usersblah.

    7.13.1release notes

  • Adds a CSRF protection layer by rejecting submissions to UI routes from external origins.

    7.12.0release notes

  • When a dataStrategy implementation returns too few results, errors are added for routes without an available result.

    7.11.0release notes

  • The routeRSCServerRequest API replaces fetchServer with serverResponse.

    7.11.0release notes

  • Stabilizes this future flag, replacing future.unstable_splitRouteModules in react-router.config.ts.

    7.10.0release notes

  • Stabilizes this future flag, replacing future.unstable_viteEnvironmentApi in react-router.config.ts.

    7.10.0release notes

  • Client-side error handlers receive location and params in the second argument, alongside errorInfo; this is a breaking change for existing adopters.

    7.9.6release notes

  • The export for unstable_RSCHydratedRouter and its utils moves to react-router/dom.

    7.9.5release notes

  • The Cloudflare development proxy plugin export is renamed and moved to @react-router/dev/vite/cloudflare.

    7.0.0upgrade guide

  • createCookie is provided from react-router rather than platform-specific packages; cookie and session APIs require the Web Crypto API crypto global.

    7.0.0upgrade guide

  • The low-level createCookieFactory API is removed because platform-specific packages no longer need to implement cookie APIs.

    7.0.0upgrade guide

  • createCookieSessionStorage is provided from react-router rather than platform-specific packages; cookie and session APIs require the Web Crypto API crypto global.

    7.0.0upgrade guide

  • The low-level createCookieSessionStorageFactory API is removed because platform-specific packages no longer need to implement session APIs.

    7.0.0upgrade guide

  • createMemorySessionStorage is provided from react-router rather than platform-specific packages; cookie and session APIs require the Web Crypto API crypto global.

    7.0.0upgrade guide

  • The low-level createMemorySessionStorageFactory API is removed because platform-specific packages no longer need to implement session APIs.

    7.0.0upgrade guide

  • createRemixStub is renamed to createRoutesStub.

    7.0.0upgrade guide

  • createSessionStorage is provided from react-router rather than platform-specific packages; cookie and session APIs require the Web Crypto API crypto global.

    7.0.0upgrade guide

  • The low-level createSessionStorageFactory API is removed because platform-specific packages no longer need to implement session APIs.

    7.0.0upgrade guide

  • The defer API and its original implementation are removed in favor of raw promises via single fetch and turbo-stream.

    7.0.0upgrade guide

  • The former esbuild-based compiler is no longer available; the Remix Vite plugin is the supported way to build full-stack SSR apps.

    7.0.0upgrade guide

  • The Remix fetcher persistence behavior previously behind this future flag is now the default.

    7.0.0upgrade guide

  • The lazy route discovery behavior previously behind this future flag is now the default.

    7.0.0upgrade guide

  • The Remix relative splat path behavior previously behind this future flag is now the default.

    7.0.0upgrade guide

  • The single fetch behavior previously behind this future flag is now the default.

    7.0.0upgrade guide

  • The Remix abort reason behavior previously behind this future flag is now the default.

    7.0.0upgrade guide

  • The fetcher persistence behavior previously behind this future flag is now the default.

    7.0.0upgrade guide

  • The form method normalization behavior previously behind this future flag is now the default.

    7.0.0upgrade guide

  • The partial hydration behavior previously behind this future flag is now the default.

    7.0.0upgrade guide

  • The relative splat path behavior previously behind this future flag is now the default.

    7.0.0upgrade guide

  • The action status revalidation behavior previously behind this future flag is now the default.

    7.0.0upgrade guide

  • The startTransition behavior previously behind this future flag is now the default.

    7.0.0upgrade guide

  • The json utility is removed; use Response.json if you still need to construct JSON responses.

    7.0.0upgrade guide

  • The Vite plugin manifest option is removed; use the buildEnd hook, which receives buildManifest, for dependent logic or writing the manifest to disk.

    7.0.0upgrade guide

  • React Router v7 requires Node 20; it no longer provides installGlobals to polyfill the fetch API.

    7.0.0upgrade guide

  • PrefetchPageDescriptor is replaced by PageLinkDescriptor.

    7.0.0upgrade guide

  • Cloudflare Pages and Workers packages have been consolidated into @react-router/cloudflare.

    7.0.0upgrade guide

  • The react-router-dom-v5-compat package is removed starting with v7.

    7.0.0upgrade guide

  • DOM environments should import RouterProvider or HydratedRouter from react-router/dom to make ReactDOM.flushSync available.

    7.0.0upgrade guide

  • The react-router-native package is removed starting with v7.

    7.0.0upgrade guide

  • The react-router-dom, @remix-run/react, @remix-run/server-runtime, and @remix-run/router packages have been collapsed into react-router; react-router-dom remains as a re-export for migration.

    7.0.0upgrade guide

  • Common runtime APIs are imported from react-router rather than runtime adapter packages.

    7.0.0upgrade guide

  • React Router v7 requires React 18 and react-dom 18.

    7.0.0upgrade guide

  • The Vite plugin export is renamed and moved from @remix/dev to @react-router/dev/vite.

    7.0.0upgrade guide

  • RemixContext is renamed to FrameworkContext.

    7.0.0upgrade guide

  • The fallbackElement prop is removed; move the fallback to hydrateFallbackElement or HydrateFallback on the root route.

    7.0.0upgrade guide

  • With partial hydration behavior, state.navigation remains idle during the initial load instead of being populated.

    7.0.0upgrade guide

  • The unstable_composeUploadHandlers API is removed.

    7.0.0upgrade guide

  • The unstable_createMemoryUploadHandler API is removed.

    7.0.0upgrade guide

  • The unstable_parseMultipartFormData API is removed.

    7.0.0upgrade guide

  • The sibling url parameter contains a URL instance with React Router's internal implementation details removed; request.url is the original request URL.

    7.0.0upgrade guide

  • The useFetcher generic now expects the type of the function generating the data, such as typeof loader or typeof action, rather than the data type.

    7.0.0upgrade guide

Security 23

  • React Router: Arbitrary Constructor Injection via deserializeErrors() in React Router SSR Hydration

    7.18.0security advisory

  • The Express adapter adjusts host computation, reading the port from x-forwarded-host according to the trust proxy setting and handling invalid hostname characters.

    7.18.0release notes

  • React Router: Open redirect via backslash in <Link> and useNavigate (CVE-2025-68470 bypass)

    7.18.0security advisory

  • React Router: RSCErrorHandler Missing Protocol Validation (XSS)

    7.18.0security advisory

  • React Router: Unauthenticated Denial of Service via Inefficient Route Matching

    7.18.0security advisory

  • Protocols are now validated in RSC render redirects.

    7.18.0release notes

  • Nonce-aware SSR components use the ServerRouter nonce when they do not provide their own value, allowing them to load on strict CSP pages.

    7.18.0release notes

  • React Router: Potential CSRF via PUT/PATCH/DELETE document requests

    7.15.1security advisory

  • React Router vulnerable to DoS via unbounded path expansion in __manifest endpoint

    7.15.0security advisory

  • React Router's vendored turbo-stream v2 allows arbitrary constructor invocation via TYPE_ERROR deserialization leading to Unauth RCE

    7.14.2security advisory

  • React Router's same-origin redirect with path starting // causes open redirect via protocol-relative URL reinterpretation

    6.30.4, 7.14.1security advisory

  • React Router vulnerable to Denial of Service via reflected user input in single-fetch

    7.14.0security advisory

  • React Router has stored XSS via unescaped Location header in prerendered redirect HTML

    7.13.2security advisoryrelease notes

  • React Router vulnerable to XSS in unstable RSC redirect handling via javascript: redirect targets

    7.13.2security advisory

  • Fixes the missing nonce on inline criticalCss.

    7.13.0release notes

  • React Router: Open redirect leading to XSS

    7.13.0security advisory

  • React Router has CSRF issue in Action/Server Action Request Processing

    7.12.0security advisoryrelease notes

  • React Router SSR XSS in ScrollRestoration

    7.12.0security advisoryrelease notes

  • React Router vulnerable to XSS via Open Redirects

    7.12.0security advisoryrelease notes

  • Validates redirect locations.

    6.30.3, 7.12.0release notesrelease notes

  • Escapes HTML in scroll restoration keys.

    7.12.0release notes

  • The @react-router/dev dependency was updated to address GHSA-vqpr-j7v3-hqw9.

    7.10.1release notes

  • React Router has unexpected external redirect via untrusted paths

    6.30.2, 7.9.6security advisoryrelease notes

Deprecations 2

  • Logs a future flag warning for this upcoming React Router v8 flag.

    7.16.0release notes

  • Marks match.shouldLoad deprecated in favor of the more powerful shouldCallHandler and shouldRevalidateArgs APIs.

    7.10.0release notes

New APIs and options 34

  • The Architect createRequestHandler option derives request URL hosts from the API Gateway request context; adopting it prepares for the behavior to become the default in v8.

    7.18.0release notes

  • A subset of the official Markdown documentation is now shipped in the package for local access by AI coding agents and React Router agent skills.

    7.17.0release notes

  • Adds an unstable hook for Framework and Data Mode that consolidates access to active and pending router states; it throws when used without a data router.

    7.15.1release notes

  • Scripts adds the provided nonce to modulepreload link elements.

    7.15.0release notes

  • Supports Link prefetch in RSC Framework Mode.

    7.14.0release notes

  • Adds prerendering and SPA Mode support for RSC Framework Mode.

    7.14.0release notes

  • Unstable RSC Framework Mode adds route module server-component exports: ServerComponent, ServerErrorBoundary, ServerLayout, and ServerHydrateFallback. Existing adopters may need to rename exports to keep them server components.

    7.14.0release notes

  • Disables request URL normalization so handlers receive the raw HTTP request, allowing them to distinguish document from data requests and avoiding multiple Request constructions.

    7.13.2release notes

  • Adds a URL parameter to route handlers containing the normalized location, so routing logic can use it when request.url is raw.

    7.13.2release notes

  • Adds the unstable RSC unstable_getRequest API.

    7.13.1release notes

  • Adds URL masking to Framework/Data Mode through <Link unstable_mask>; the masked location is available on useLocation().unstable_mask. Masked URLs are for SPA use cases and are removed from history.state during SSR.

    7.13.1release notes

  • Adds a crossOrigin prop to the Links component.

    7.13.0release notes

  • Adds a react-router.config.ts field for specifying external origins permitted to submit to UI routes.

    7.12.0release notes

  • Adds an opt-in flag that makes request.pathname consistent across document and data requests when the browser URL has a trailing slash, using a new _.data format for client-side data requests.

    7.12.0release notes

  • Exports this history creator to help apps using unstable_HistoryRouter migrate from v6 to v7.

    7.12.0release notes

  • RSC Framework mode supports custom entrypoints.

    7.11.0release notes

  • In RSC, data() can be thrown during server component rendering to transmit data to the boundary.

    7.11.0release notes

  • RSC supports throwing redirect Responses at render time.

    7.11.0release notes

  • Navigation and fetcher APIs accept this flag to opt out of standard revalidation; route shouldRevalidate functions receive its value and have the final say.

    7.11.0release notes

  • Adds unstable_pattern to the parameters for client-side unstable_onError.

    7.10.0release notes

  • Adds an opt-in prop for HydratedRouter and RouterProvider to wrap Link/Form navigations in transitions and surface optimistic navigation state; requires React 19 for Framework/Data Mode.

    7.10.0release notes

  • Adds a router flag to control use of React.startTransition and React.useOptimistic; behavior depends on the flag value and mode.

    7.10.0release notes

  • Add an option to run pre-rendering concurrently, potentially speeding up the build.

    7.9.5release notes

  • Add instrumentation for route loaders, actions, middleware, lazy routes, server request handlers, and client navigations and fetches.

    7.9.5release notes

  • Loaders, actions, and middleware receive the un-interpolated route pattern, useful for aggregating logs and metrics by route.

    7.9.5release notes

  • Enables middleware to run code before and after Response generation for matched paths, supporting reusable authentication, logging, error handling, and data preprocessing.

    7.0.0upgrade guide

  • Passes the raw HTTP request to handlers instead of normalizing its URL; use the sibling url parameter for normalized routing logic.

    7.0.0upgrade guide

  • Enables client-side route exports to be split into independently loadable chunks, so they can load and execute while route component code is downloading.

    7.0.0upgrade guide

  • Preserves trailing-slash semantics in Framework mode data request URLs, including changing the root data request from /_root.data to /_.data.

    7.0.0upgrade guide

  • The Vite plugin adds a prerender config for SSG, pre-rendering .html and .data files at build time for static serving from a server or CDN.

    7.0.0upgrade guide

  • A react-router/dom subpath export provides DOM-specific RouterProvider and HydratedRouter with ReactDOM.flushSync support, keeping react-dom optional for non-DOM use cases.

    7.0.0upgrade guide

  • The Vite plugin uses app/routes.ts to define routes, exporting a RouteConfig built with route, index, and layout helpers.

    7.0.0upgrade guide

  • Route component exports receive params, loader data, and action data as props.

    7.0.0upgrade guide

  • The Architect adapter can opt into using event.requestContext.domainName when creating the request, falling back to the Host header.

    7.0.0upgrade guide

Performance 3

  • Precomputes and caches flattened/ranked route branches and avoids unnecessary matchRoutes calls, improving server-side handling and client-side navigation performance.

    7.15.0release notes

  • RSC Framework mode optimizes react-server-dom-webpack when it is present in the project package.json.

    7.11.0release notes

  • Optimizes href() to avoid backtracking regex on splat.

    7.10.0release notes

Behavior and default changes 27

  • When this option is enabled, Framework Mode build hooks now ignore external Vite server environments and process only the app's own server build.

    7.18.0release notes

  • When enabled, RSC route module server exports are no longer scanned by the client dependency optimizer.

    7.17.0release notes

  • Memoizes the hook result so it has a stable identity and changes only when fetchers change.

    7.15.1release notes

  • Renames unstable_mask to mask on Link, useLinkClickHandler, useNavigate, and Location; Location.mask is optional.

    7.15.0release notes

  • Stabilizes unstable_useTransitions as useTransitions on router components and useLinkClickHandler.

    7.15.0release notes

  • Supports prerendering multiple server bundles when using this Vite environment API.

    7.14.0release notes

  • Loosens the glob check so ** matches all domains.

    7.13.0release notes

  • Client-side middleware can now return redirects.

    7.11.0release notes

  • RSC Framework mode now manually chunks react and react-router dependencies.

    7.11.0release notes

  • The client-side error handler is stable on RouterProvider and HydratedRouter; replace the former unstable_onError prop if you adopted it.

    7.11.0release notes

  • RSC supports throwing Response from the server component render phase, but its body is not serialized because async work is not allowed during error encoding.

    7.11.0release notes

  • Stabilizes this dataStrategy match API, replacing match.unstable_shouldCallHandler().

    7.10.0release notes

  • Stabilizes this dataStrategy match API, replacing match.unstable_shouldRevalidateArgs.

    7.10.0release notes

  • Stabilizes fetcher.reset() as the replacement for fetcher.unstable_reset().

    7.10.0release notes

  • Environment variables are loaded before routes.ts is evaluated, allowing route configuration to be computed from VITE_-prefixed variables.

    7.10.0release notes

  • Actions may now return undefined.

    7.0.0upgrade guide

  • The optimize dependencies behavior previously behind this future flag is now the default.

    7.0.0upgrade guide

  • Link gains prefetching support when using Remix SSR.

    7.0.0upgrade guide

  • Loaders may now return undefined.

    7.0.0upgrade guide

  • NavLink gains prefetching support when using Remix SSR.

    7.0.0upgrade guide

  • unstable_dataStrategy is stabilized.

    7.0.0upgrade guide

  • unstable_patchRoutesOnNavigation is stabilized.

    7.0.0upgrade guide

  • useFetcher().load now exposes the underlying router promise for composition in React 19 APIs.

    7.0.0upgrade guide

  • useFetcher().submit now exposes the underlying router promise for composition in React 19 APIs.

    7.0.0upgrade guide

  • useNavigate now exposes the underlying router promise, allowing composition with React 19 promise-handling APIs.

    7.0.0upgrade guide

  • useRevalidator().revalidate now exposes the underlying router promise for composition in React 19 APIs.

    7.0.0upgrade guide

  • useSubmit now exposes the underlying router promise, allowing composition with React 19 promise-handling APIs.

    7.0.0upgrade guide

Tooling 9

  • Consumers of the unstable unstable_reactRouterRSC Vite plugin must install @vitejs/plugin-react and add the React plugin to their Vite plugins array.

    7.14.2release notes

  • Adds TypeScript 6 support to the package's peer dependency ranges.

    7.14.1release notes

  • The reveal command supports RSC Framework Mode for entry.client, entry.rsc, and entry.ssr.

    7.14.0release notes

  • React Router adds support for Vite 8.

    7.14.0release notes

  • Framework mode now supports vite preview, making it easy to preview a production build.

    7.11.0release notes

  • Cloudflare projects should use this package instead of the React Router Cloudflare dev proxy.

    7.0.0upgrade guide

  • Enables support for Vite's experimental Environment API; custom Vite configuration relying on isSsrBuild may need to move into per-environment configuration.

    7.0.0upgrade guide

  • Route module types are generated and available through imports from ./+types/<route filename without extension>.

    7.0.0upgrade guide

  • React Router generates types for each route module and passes typed props to route component exports; import generated types from ./+types/<route filename without extension>.

    7.0.0upgrade guide

Fixes and other changes 60

  • Corrected the package.json main field for CommonJS builds.

    7.18.1release notes

  • Fixes server handler prerender responses when ssr is false and future.v8_trailingSlashAwareDataRequests is enabled, avoiding false-positive SPA Mode detection.

    7.18.0release notes

  • Vite server.watch configuration is passed to the child compiler in development mode.

    7.18.0release notes

  • URL normalization logic is consolidated and handles mixed slashes better.

    7.18.0release notes

  • Future flag warning URLs are fixed so warnings point to the correct resources.

    7.17.0release notes

  • Each future flag warning is logged only one time.

    7.17.0release notes

  • react-router-serve normalizes path separators so Windows-built server artifacts can serve /assets/* correctly when run on Linux.

    7.16.0release notes

  • Browser URL creation uses the configured history window rather than the global window, preserving the correct URL origin in custom window contexts.

    7.16.0release notes

  • The manifest path is disabled when lazy route discovery is disabled.

    7.16.0release notes

  • The JSON-LD script type accepts one or multiple LdJsonObject values, allowing multiple schemas in a single script tag emitted by Meta.

    7.16.0release notes

  • Ignores writes after Express responses close, avoiding adapter errors for client disconnects when the response stream is destroyed or ended.

    7.16.0release notes

  • Its return type now preserves the discriminated union across navigation states.

    7.16.0release notes

  • Honors writable backpressure by awaiting drain and rejects if the writable errors or closes mid-stream.

    7.16.0release notes

  • Honors writable backpressure by awaiting drain and rejects if the writable errors or closes mid-stream.

    7.16.0release notes

  • Fixes basename conflicts with the app directory when Vite base and React Router basename both match that directory, preventing server-build virtual module import errors.

    7.15.1release notes

  • Updates fetcher Maps immutably to prevent delayed React renders from reading an updated but uncommitted Map, which could cause brief flickers in fetcher-driven optimistic UI.

    7.15.1release notes

  • Calls the onError callback for synchronous initial loader errors in SPA mode.

    7.15.1release notes

  • Fixes stale SSR data when a client navigation aborts pending hydration before the hydration clientLoader resolves.

    7.15.1release notes

  • Fixes single-fetch calls incorrectly including parent routes without shouldRevalidate when defaultShouldRevalidate is false.

    7.15.0release notes

  • Parent middleware redirects are now properly handled during fetcher.load.

    7.14.2release notes

  • The param argument types reject null for required params, allow omitted optional params, and allow extra keys.

    7.14.2release notes

  • Typegen now emits pages: never; for layouts with no pages instead of producing invalid pages: ;.

    7.14.2release notes

  • The unstable unstable_reactRouterRSC Vite plugin more reliably splits route modules.

    7.14.2release notes

  • The react-router/dom RouterProvider no longer redundantly omits flushSync from its props.

    7.14.2release notes

  • Fixes a potential race condition when initial loaders land before the RouterProvider layout effect calls router.subscribe.

    7.14.1release notes

  • Double slashes in redirect paths are normalized.

    6.30.4, 7.14.1release notesrelease notes

  • Fixes a memory leak caused by an AbortSignal listener that was not removed.

    7.14.0release notes

  • The vendored turbo-stream implementation no longer recurses, allowing large payloads to be encoded and decoded.

    7.14.0release notes

  • Fixes clientLoader.hydrate when an ancestor route is also hydrating a clientLoader.

    7.13.2release notes

  • Fixes a type error when passing Framework Mode route components using Route.ComponentProps to createRoutesStub.

    7.13.2release notes

  • Fixes a crash when Unix socket files exist in the project root.

    7.13.2release notes

  • Fixes percent encoding in relative path navigation.

    7.13.2release notes

  • Fixes HydrateFallback rendering during initial lazy route discovery when a splat route matches.

    7.13.1release notes

  • Preserves query parameters and the hash when reloading after a manifest version mismatch.

    7.13.1release notes

  • Failed origin checks in RSC now return a 400 status and appropriate UI instead of a generic 500.

    7.13.1release notes

  • Improves the error message shown when the Origin header is invalid.

    7.13.1release notes

  • Failed origin checks return a 400 status instead of a 500.

    7.13.0release notes

  • Fixes route file paths when the routes directory is outside the app directory.

    7.13.0release notes

  • Fixes double slash normalization for paths with a colon.

    7.13.0release notes

  • Preserves clientLoader.hydrate=true when using <HydratedRouter unstable_instrumentations>.

    7.12.0release notes

  • Fixes path generation when parameters have suffixes, such as /books/:id.json.

    7.12.0release notes

  • Fixes Maximum call stack size exceeded errors when HMR runs against code with cyclic imports.

    7.12.0release notes

  • Passes the <Scripts nonce> value to the underlying importmap script tag when future.unstable_subResourceIntegrity is enabled.

    7.12.0release notes

  • Skips SSR middleware in the vite preview server when running in SPA mode.

    7.12.0release notes

  • The Router component now permits omission of the unstable_useTransitions prop for backwards compatibility.

    7.11.0release notes

  • The package now imports the ESM package pkg-types with a dynamic import to fix issues on Node 20.18.

    7.10.1release notes

  • The React 18 stub now uses a stable setter function to avoid potential useEffect loops, particularly with <Link viewTransition>.

    7.10.1release notes

  • Preserves statusText on the ErrorResponse instance when a route handler throws data().

    7.10.0release notes

  • Fixes submission failures for plain objects containing a tagName property.

    7.10.0release notes

  • Corrects defaultShouldRevalidate after an action returns a 4xx/5xx response, preventing unintended revalidations when functions rely on that parameter.

    7.10.0release notes

  • In Framework/Data Mode, the returned promise now properly tracks the duration of popstate navigations such as navigate(-1).

    7.10.0release notes

  • Properly handles ancestor thrown middleware errors before next() on fetcher submissions.

    7.9.6release notes

  • Fixes splat routes interfering with multiple calls to patchRoutesOnNavigation.

    7.9.6release notes

  • Loads the ESM-only p-map dependency with a dynamic import to avoid issues on Node 20.18 and below.

    7.9.6release notes

  • Normalizes double-slashes in resolvePath.

    6.30.2, 7.9.6release notesrelease notes

  • Action handlers now run for routes with middleware even when no loader is present.

    7.9.5release notes

  • Route navigation no longer removes CSS link elements used by dynamic imports.

    7.9.5release notes

  • Type generation registers route module types only for routes within the app directory.

    7.9.5release notes

  • The handle field is now type-safe when accessed through unstable_useRoute().

    7.9.5release notes

  • ScrollRestoration can now restore properly on an SSR'd document load.

    7.0.0upgrade guide

react-router 69 changes

Breaking changes 7

  • Fixes double slash normalization for colon URLs. navigate() is intended for in-app navigations, not external navigations to other domains; this may be a breaking bug fix for users who used it for external navigation.

    6.30.6release notes

  • Relative link targets resolve against the route path; search-only targets use the current pathname, and trailing slashes do not change the link destination.

    6.0.0upgrade guide

  • The element prop lets route definitions render elements, pass custom props including children, and use React.Suspense for lazy-loaded route elements.

    6.0.0upgrade guide

  • Relative route paths are resolved against the parent route, so nested routes no longer need paths built from the root.

    6.0.0upgrade guide

  • Routes are ranked automatically, so the best match is selected regardless of definition order and routes are less likely to become unreachable.

    6.0.0upgrade guide

  • Replaces Switch with a component that automatically picks the best route for the current URL and allows routes to be spread across the app.

    6.0.0upgrade guide

  • A * at the end of a route path opts into deep matching, allowing additional routing in a nested component.

    6.0.0upgrade guide

New APIs and options 1

  • Adds first-class support for layout routes, rendering nested route content within a parent layout.

    6.0.0upgrade guide

Performance 1

  • The decodePath call was lifted out of the hot path during route matching.

    6.30.4release notes

react-router 519 changes

Breaking changes 4

  • Development mode throws an error when different builds are combined, such as CJS imports with ESM imports.

    5.0.0release notes

  • Access to the old context API fails; use withRouter() or a <Route/> instead.

    5.0.0release notes

  • Mixing per-file imports with package-level imports can cause a context mismatch; import both components from the same build.

    5.0.0release notes

  • react-router and react-router-dom (or react-router-native) must be upgraded to the exact same version to avoid errors with router components.

    5.0.0release notes

Security 1

  • Development builds no longer use eval, making them compliant with unsafe-eval CSP.

    5.0.0release notes

Deprecations 2

  • Per-file imports are deprecated and log a warning; they will be removed in a future major version.

    5.0.0release notes

  • Import router exports by destructuring them from the main bundle; requiring individual router files remains supported but warns in development.

    5.0.0upgrade guide

New APIs and options 3

Behavior and default changes 5

  • Support for React 16 is improved while maintaining compatibility with React >= 15.

    5.0.0upgrade guide

  • React Router migrated to the new React context API and includes a polyfill for React versions below 16.2.

    5.0.0release notes

  • The react-router dependency in each react-router-dom release is pinned to prevent version mismatches.

    5.0.0upgrade guide

  • Route supports multiple child nodes when using React 16.0 or later.

    5.0.0release notes

  • Using React 16's new context API avoids the update-blocking problem users may previously have had to work around.

    5.0.0upgrade guide

Tooling 1

  • Pre-optimized production builds mean you no longer have to manually set process.env.NODE_ENV to production in your build script.

    5.0.0upgrade guide

Fixes and other changes 3