NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
npm · #1757 most downloaded on npm
Declarative routing for React web applications
Last release 4 days ago
15 Sep 2026
Ships fairly regularly
a new release about every 2 weeks
Nearly every release is documented
notes for 60 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
10 years old
1063 releases · first in 2016
Support absolute URLs in . If the URL is for the current origin, it will still do a client-side navigation. If the URL is for a different origin then
Date: 2023-01-26
Support absolute URLs in <Link to>. If the URL is for the current origin, it will still do a client-side navigation. If the URL is for a different origin then it will do a fresh document request for the new origin. (#9900)
<Link to="https://neworigin.com/some/path"> {/* Document request */}
<Link to="//neworigin.com/some/path"> {/* Document request */}
<Link to="https://www.currentorigin.com/path"> {/* Client-side navigation */}
shouldRevalidate calls (#9948)
shouldRevalidate function was only being called for explicit revalidation scenarios (after a mutation, manual useRevalidator call, or an X-Remix-Revalidate header used for cookie setting in Remix). It was not properly being called on implicit revalidation scenarios that also apply to navigation loader revalidation, such as a change in search params or clicking a link for the page we're already on. It's now correctly called in those additional scenarios.current*/next* parameters reflected the static fetcher.load URL (and thus were identical). Instead, they should have reflected the navigation that triggered the revalidation (as the form* parameters did). These parameters now correctly reflect the triggering navigation.useSearchParams (#9969)preventScrollReset on <fetcher.Form> (#9963)pagehide instead of beforeunload for <ScrollRestoration>. This has better cross-browser support, specifically on Mobile Safari. (#9945)instanceof check from isRouteErrorResponse to avoid bundling issues on the server (#9930)defer call only contains critical data and remove the AbortController (#9965)File FormData entries (#9867)react-router-dom-v5-compat - Fix SSR useLayoutEffect console.error when using CompatRouter (#9820)Full Changelog: v6.7.0...v6.8.0
One column per quarter.
Nothing published for this version
Nothing published for this version
Add unstable_useBlocker/unstable_usePrompt hooks for blocking navigations within the app's location origin (#9709, #9932)
Date: 2023-01-18
unstable_useBlocker/unstable_usePrompt hooks for blocking navigations within the app's location origin (#9709, #9932)preventScrollReset prop to <Form> (#9886)useBeforeUnload (#9709)generatePath when optional params are present (#9764)<Await> to accept ReactNode as children function return result (#9896)jsdom bug workaround in tests (#9824)Full Changelog: v6.6.2...v6.7.0
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Ensure useId consistency during SSR
Date: 2023-01-09
useId consistency during SSR (#9805)Full Changelog: v6.6.1...v6.6.2
Nothing published for this version
Include submission info in shouldRevalidate on action redirects (#9777, #9782)
Date: 2022-12-23
shouldRevalidate on action redirects (#9777, #9782)actionData on action redirect to current location (#9772)Full Changelog: v6.6.0...v6.6.1
Nothing published for this version
Nothing published for this version
This minor release is primarily to stabilize our SSR APIs for Data Routers now that we've wired up the new RouterProvider in Remix as part of the Reac
Date: 2022-12-21
This minor release is primarily to stabilize our SSR APIs for Data Routers now that we've wired up the new RouterProvider in Remix as part of the React Router-ing Remix work.
unstable_ prefix from createStaticHandler/createStaticRouter/StaticRouterProvider (#9738)useBeforeUnload() hook (#9664)<Form method> and useSubmit method values (#9664)<button formmethod> form submission overriddes (#9664)replace on submissions and PUSH on submission to new paths (#9734)useLoaderData usage in errorElement (#9735)Error objects from StaticRouterProvider (#9664)hydrationData (#9664)Full Changelog: v6.5.0...v6.6.0
Nothing published for this version
This release introduces support for Optional Route Segments. Now, adding a ? to the end of any path segment will make that entire segment optional. Th
Date: 2022-12-16
This release introduces support for Optional Route Segments. Now, adding a ? to the end of any path segment will make that entire segment optional. This works for both static segments and dynamic parameters.
Optional Params Examples
<Route path=":lang?/about> will match:
/:lang/about/about<Route path="/multistep/:widget1?/widget2?/widget3?"> will match:
/multistep/multistep/:widget1/multistep/:widget1/:widget2/multistep/:widget1/:widget2/:widget3Optional Static Segment Example
<Route path="/home?"> will match:
//home<Route path="/fr?/about"> will match:
/about/fr/about<Route path="prefix-:param">, to align with how splat parameters work. If you were previously relying on this behavior then it's recommended to extract the static portion of the path at the useParams call site: (#9506)// Old behavior at URL /prefix-123
<Route path="prefix-:id" element={<Comp /> }>
function Comp() {
let params = useParams(); // { id: '123' }
let id = params.id; // "123"
...
}
// New behavior at URL /prefix-123
<Route path=":id" element={<Comp /> }>
function Comp() {
let params = useParams(); // { id: 'prefix-123' }
let id = params.id.replace(/^prefix-/, ''); // "123"
...
}
headers on loader request's after SSR document action request (#9721)Full Changelog: v6.4.5...v6.5.0
Nothing published for this version
Nothing published for this version
Fix requests sent to revalidating loaders so they reflect a GET request
Date: 2022-12-07
GET request (#9680)instanceof Response checks in favor of isResponse (#9690)URL creation in Cloudflare Pages or other non-browser-environments (#9682, #9689)requestContext support to static handler query/queryRoute (#9696)
queryRoute(path, routeId) has been changed to queryRoute(path, { routeId, requestContext })Full Changelog: v6.4.4...v6.4.5
Nothing published for this version
Nothing published for this version
Nothing published for this version
Throw an error if an action/loader function returns undefined as revalidations need to know whether the loader has previously been executed. undefined
action/loader function returns undefined as revalidations need to know whether the loader has previously been executed. undefined also causes issues during SSR stringification for hydration. You should always ensure your loader/action returns a value, and you may return null if you don't wish to return anything. (#9511)basename in static data routers (#9591)ErrorResponse bodies to contain more descriptive text in internal 403/404/405 scenariosNavLink and descendant <Routes> (#9589, #9647)ErrorResponse instances when using built-in hydration (#9593)basename in static data routers (#9591)@remix-run/router@1.0.4react-router@6.4.4Full Changelog: https://github.com/remix-run/react-router/compare/react-router-dom@6.4.3...react-router-dom@6.4.4
Nothing published for this version
Nothing published for this version
Nothing published for this version
Generate correct values when using createHashRouter
Date: 2022-11-01
<a href> values when using createHashRouter (#9409)formAction pathnames when an index route also has a path (#9486)relative=path prop on NavLink (#9453)NavLink behavior for root urls (#9497)useRoutes should be able to return null when passing locationArg (#9485)initialEntries type in createMemoryRouter (#9498)basename and relative routing in loader/action redirects (#9447)action function (#9455)@remix-run/router (#9446)createURL in local file execution in Firefox (#9464)Full Changelog: v6.4.2...v6.4.3
Nothing published for this version
Nothing published for this version
Nothing published for this version
Respect basename in useFormAction
Date: 2022-10-06
basename in useFormAction (#9352)IndexRouteObject and NonIndexRouteObject types to make hasErrorElement optional (#9394)RouteObject/RouteProps types to surface the error in TypeScript. (#9366)Full Changelog: v6.4.1...v6.4.2
Nothing published for this version
Nothing published for this version
Preserve state from initialEntries
Date: 2022-09-22
initialEntries (#9288)?index for fetcher get submissions to index routes (#9312)Full Changelog: v6.4.0...v6.4.1
Nothing published for this version
Whoa this is a big one! 6.4.0 brings all the data loading and mutation APIs over from Remix. Here's a quick high level overview, but it's recommended
Date: 2022-09-13
Whoa this is a big one! 6.4.0 brings all the data loading and mutation APIs over from Remix. Here's a quick high level overview, but it's recommended you go check out the docs, especially the feature overview and the tutorial.
New react-router APIs
createMemoryRouter<RouterProvider>loader and mutate with a Route actionerrorElementdefer and AwaitNew react-router-dom APIs
createBrowserRouter/createHashRouter<Form> componentuseFetcher()defer and Await<ScrollRestoration><Link relative="path"> (#9160)useLocation returns the scoped location inside a <Routes location> component (#9094)<Link replace> prop if it is defined (#8779)Full Changelog: v6.3.0...v6.4.0
fix: remove internal router singleton
fix: remove internal router singleton (#9227)
This change removes the internal module-level routerSingleton we create and maintain inside our data routers since it was causing a number of headaches for non-simple use cases:
_resetModuleScope singleton for our tests<Route> objects cause non-intuitive behavior based on idiomatic react expectations
<Route>'s won't get picked up<Route>'s during local dev won't get picked up during HMRInstead, we are going to lift the singleton out into user-land, so that they create the router singleton and manage it outside the react tree - which is what react 18 is encouraging with useSyncExternalStore anyways! This also means that since users create the router - there's no longer any difference in the rendering aspect for memory/browser/hash routers (which only impacts router/history creation) - so we can get rid of those and trim to a simple RouterProvider
// Before
function App() {
<DataBrowserRouter>
<Route path="/" element={<Layout />}>
<Route index element={<Home />}>
</Route>
<DataBrowserRouter>
}
// After
let router = createBrowserRouter([{
path: "/",
element: <Layout />,
children: [{
index: true,
element: <Home />,
}]
}]);
function App() {
return <RouterProvider router={router} />
}
If folks still prefer the JSX notation, they can leverage createRoutesFromElements (aliased from createRoutesFromChildren since they are not "children" in this usage):
let routes = createRoutesFromElements(
<Route path="/" element={<Layout />}>
<Route index element={<Home />}>
</Route>
);
let router = createBrowserRouter(routes);
function App() {
return <RouterProvider router={router} />
}
And now they can also hook into HMR correctly for router disposal:
if (import.meta.hot) {
import.meta.hot.dispose(() => router.dispose());
}
And finally since <RouterProvider> accepts a router, it makes unit testing easer since you can create a fresh router with each test.
Removed APIs
<DataMemoryRouter><DataBrowserRouter><DataHashRouter><DataRouterProvider><DataRouter>Modified APIs
createMemoryRouter/createBrowserRouter/createHashRouter used to live in @remix-run/router to prevent devs from needing to create their own history. These are now moved to react-router/react-router-dom and handle the RouteObject -> AgnosticRouteObject conversion.Added APIs
<RouterProvider>createRoutesFromElements (alias of createRoutesFromChildren)Updated dependencies
Nothing published for this version
Nothing published for this version
Nothing published for this version
### Patch Changes - Updated dependencies - react-router@6.4.0-pre.11 - react-router-dom@6.4.0-pre.11
To that end, they are available for use, but are subject to breaking changes in the next minor release._
SSR Updates for React Router (#9058)
Note: The Data-Router SSR aspects of @remix-run/router and react-router-dom are being released as unstable in this release (unstable_createStaticHandler and unstable_DataStaticRouter), and we plan to finalize them in a subsequent minor release once the kinks can be worked out with the Remix integration. To that end, they are available for use, but are subject to breaking changes in the next minor release.
useRenderDataRouter() in favor of <DataRouterProvider>/<DataRouter><DataStaticRouter>/<DataBrowserRouter>/<DataHashRouter>
window.__staticRouterHydrationData<DataStaticRouter hydrate={false}>hydrationData to <DataBrowserRouter>/<DataHashRouter><DataStaticRouter> now tracks it's own SSR error boundaries on StaticHandlerContextStaticHandlerContext now exposes statusCode/loaderHeaders/actionHeadersfoundMissingHydrationData check removed since Remix routes may have loaders (for modules) that don't return data for loaderDataUpdated dependencies
feat: add basename support for data routers
fix: Make path resolution trailing slash agnostic
26302209: Respect the prop if it is defined
<Link replace> prop if it is defined (#8779)react-router@6.4.0-pre.7react-router@6.4.0-pre.7react-router-dom@6.4.0-pre.7### Patch Changes - react-router@6.4.0-pre.6
react-router-dom peer dependency version
Fix broken require for CJS builds
### Patch Changes - Fix missing dist files
dist filesMake fallbackElement optional and change type to ReactNode (type changes only)
fallbackElement optional and change type to ReactNode (type changes only) (#8896)This pre-release brings the data abstractions from Remix to React Router. There will be more complete release notes for the v6.4 final release. Here a
This pre-release brings the data abstractions from Remix to React Router. There will be more complete release notes for the v6.4 final release. Here are a couple quick resources to take it for a spin:
We have a lot more documentation work to do around guides, examples, and use-cases, but the API reference documentation on the new beta site is already quite complete.
npm i react-router-dom@next
Enjoy!
Nothing published for this version
Added the v5 to v6 backwards compatibility package 💜 (https://github.com/remix-run/react-router/pull/8752). The official guide can be found in this di
Full Changelog: https://github.com/remix-run/react-router/compare/v6.2.2...v6.3.0
Date: 2022-03-31
Full Changelog: v6.2.2...v6.3.0
Fixed nested splat routes that begin with special URL-safe characters
Full Changelog: https://github.com/remix-run/react-router/compare/v6.2.1...v6.2.2
Date: 2022-02-28
Full Changelog: v6.2.1...v6.2.2
Nothing published for this version
This release updates the internal history dependency to 5.2.0.
This release updates the internal history dependency to 5.2.0.
Full Changelog: https://github.com/remix-run/react-router/compare/v6.2.0...v6.2.1
Date: 2021-12-17
history dependency to 5.2.0.Full Changelog: v6.2.0...v6.2.1
Fixed the RouteProps element type, which should be a ReactNode
RouteProps element type, which should be a ReactNode (#8473)useOutlet for top-level routes (#8483)Full Changelog: https://github.com/remix-run/react-router/compare/v6.1.1...v6.2.0
Date: 2021-12-17
RouteProps element type, which should be a ReactNode (#8473)useOutlet for top-level routes (#8483)Full Changelog: v6.1.1...v6.2.0
In v6.1.0 we inadvertently shipped a new, undocumented API that will likely introduce bugs (#7586). We have flagged HistoryRouter as unstable_HistoryR
In v6.1.0 we inadvertently shipped a new, undocumented API that will likely introduce bugs (#7586). We have flagged HistoryRouter as unstable_HistoryRouter, as this API will likely need to change before a new major release.
Full Changelog: https://github.com/remix-run/react-router/compare/v6.1.0...v6.1.1
Date: 2021-12-11
HistoryRouter as unstable_HistoryRouter, as this API will likely need to change before a new major release.Full Changelog: v6.1.0...v6.1.1
Fixed a bug that broke support for base64 encoded IDs on nested routes
<Outlet> can now receive a context prop. This value is passed to child routes and is accessible via the new useOutletContext hook. See the API docs for details. (#8461)<NavLink> can now receive a child function for access to its props. (#8164)useMatch and matchPath. For example, when you call useMatch("foo/:bar/:baz"), the path is parsed and the return type will be PathMatch<"bar" | "baz">. (#8030)Full Changelog: https://github.com/remix-run/react-router/compare/v6.0.1...v6.1.0
Date: 2021-12-10
<Outlet> can now receive a context prop. This value is passed to child routes and is accessible via the new useOutletContext hook. See the API docs for details. (#8461)<NavLink> can now receive a child function for access to its props. (#8164)useMatch and matchPath. For example, when you call useMatch("foo/:bar/:baz"), the path is parsed and the return type will be PathMatch<"bar" | "baz">. (#8030)Full Changelog: v6.0.2...v6.1.0
Your coding agent can read these notes before it upgrades. Set up the MCP server →