diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ef0eafb2d6..030777127e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -129,7 +129,7 @@ jobs: run: pnpm build - name: Publish to npm and create releases - run: pnpm changes:publish -- --branch=${{ github.ref_name }} + run: pnpm changes:publish --branch=${{ github.ref_name }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/CHANGELOG.md b/CHANGELOG.md index b2055c192f..564b788e0d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,7 +16,16 @@ We manage release notes in this file instead of the paginated Github Releases Pa Table of Contents - [React Router Releases](#react-router-releases) + - [v8.0.0](#v800) + - [Baseline Support](#baseline-support) + - [Adopted Future Flag Behavior](#adopted-future-flag-behavior) + - [Removed `react-router-dom`](#removed-react-router-dom) + - [Removed deprecated `meta` `data` fields](#removed-deprecated-meta-data-fields) + - [Cloudflare Vite Plugin](#cloudflare-vite-plugin) + - [`@react-router/architect` `useRequestContextDomainName`](#react-routerarchitect-userequestcontextdomainname) +- [React Router v7 Releases](#react-router-v7-releases) - [v7.18.0](#v7180) + - [CSRF Check Logic Fix](#csrf-check-logic-fix) - [v7.17.0](#v7170) - [v7.16.0](#v7160) - [v7.15.1](#v7151) @@ -93,6 +102,182 @@ We manage release notes in this file instead of the paginated Github Releases Pa +## v8.0.0 + +Date: 2026-06-17 + +### What's Changed + +React Router v8 is here! + +We introduced a new [Open Governance](https://remix.run/blog/rr-governance) model last year and this marks the first major release on our new planned yearly major release cadence. We chose the June timeframe this year to align with the EOL timeframe for Node 20. Node 22 is [scheduled](https://nodejs.org/en/about/previous-releases) to reach EOL in the May 2027 timeframe so we'll be aiming for a v9 release around the same time next year. + +Our [API Development Strategy](https://reactrouter.com/community/api-development-strategy) aims to make major releases relatively boring by introducing breaking changes ahead of time behind [Future Flags](https://reactrouter.com/upgrading/v7). If you've adopted all active future flags in v7, then from a React Router API surface you're in good shape for v8. All `future.v8_*` flags have been removed (or lifted to a top-level config) and their behaviors are now the default. + +#### Baseline Support + +React Router v8 updates the following minimum supported versions: + +- Node 22.22.0+ + - Starting with v8, React Router will officially support all Active LTS node versions and only the **latest** minor branch of Maintenance LTS versions + - This better allows us to bump minimum Maintenance LTS versions to account for newly released security patches + - It also allows us to more quickly and easily adopt new Active LTS features backported to Maintenance LTS lines + - Upgraded minimum Maintenance LTS versions will be done in React Router minor releases +- React 19.2.7+ +- Vite 7+ + +To modernize the library, React Router is now published as an ESM-only module and tsconfig `target`/`lib` fields have been updated to ES2022 across the board + +#### Adopted Future Flag Behavior + +The following v8 future flags have been removed and their behaviors are now the default: + +- `future.v8_trailingSlashAwareDataRequests` +- `future.v8_passThroughRequests` +- `future.v8_middleware` +- `future.v8_viteEnvironmentApi` +- `future.v8_splitRouteModules` has been moved to a to a top-level `splitRouteModules` config option and is enabled by default + +#### Removed `react-router-dom` + +In v7, we collapsed the DOM APIs into `react-router/dom`, but to ease the v6->v7 upgrade we continued re-exporting everything through `react-router-dom`. We have now dropped `react-router-dom`, so if you didn't get around to swapping your imports in v7, you will need to swap them to `react-router` and `react-router/dom` for v8. + +#### Removed deprecated `meta` `data` fields + +The `data` fields passed to route module `meta` functions were deprecated in v7 and are remove din v8. Use `loaderData` instead of `data` on `MetaArgs` and each item in `MetaArgs.matches`. + +#### Cloudflare Vite Plugin + +The React Router Cloudflare dev proxy (`@react-router/dev/vite/cloudflare`) has been removed in v8. Cloudflare projects should use [`@cloudflare/vite-plugin`](https://developers.cloudflare.com/workers/vite-plugin/) instead. + +#### `@react-router/architect` `useRequestContextDomainName` + +The `@react-router/architect` `createRequestHandler` `useRequestContextDomainName` option has been removed as that is now the default behavior in v8. + +### Major Changes + +- `react-router` - Update minimum Node version to 22.22.0 ([#14928](https://github.com/remix-run/react-router/pull/14928)) +- `react-router` - Update minimum React version to 19.2.7 ([#15062](https://github.com/remix-run/react-router/pull/15062)) +- `react-router` - Remove the `future.v8_trailingSlashAwareDataRequests` flag ([#15100](https://github.com/remix-run/react-router/pull/15100)) + - Trailing slash-aware data request URLs are now the default behavior. +- `react-router` - Remove `future.v8_passThroughRequests` flag - the raw incoming `request` is now always passed through to `loader`/`action`. Use `url` for the normalized URL without React Router-specific implementation details (`.data` suffixes, `index`/`_routes` search params). ([#15079](https://github.com/remix-run/react-router/pull/15079)) +- `react-router` - Remove `future.v8_middleware` flag — middleware is always enabled in v8 ([#15078](https://github.com/remix-run/react-router/pull/15078)) + - The `future.v8_middleware` flag has been removed; middleware is now always enabled + - The `context` parameter passed to `loader`, `action`, and `middleware` functions is always a `RouterContextProvider` instance + - `getLoadContext` functions in custom servers must return a `RouterContextProvider` — returning a plain object is no longer supported + - The `MiddlewareEnabled` type (previously exported as `UNSAFE_MiddlewareEnabled`) has been removed since the conditional it gated is now unconditional + - The `Future` module augmentation pattern (`interface Future { v8_middleware: true }`) is no longer needed to type `context` in Data Mode +- `react-router` - Remove `future.v8_passThroughRequests` flag - the raw incoming `request` is now always passed through to `loader`/`action`. ([#15079](https://github.com/remix-run/react-router/pull/15079)) +- `react-router` - Move `future.v8_splitRouteModules` to a top-level `splitRouteModules` config option and change the default behavior to `true` ([#15086](https://github.com/remix-run/react-router/pull/15086)) + - Set `splitRouteModules: false` to keep route modules in a single chunk + - Set `splitRouteModules: "enforce"` to require all routes to be splittable +- `@react-router/dev` - Removed the `future.v8_viteEnvironmentApi` flag because the Vite Environment API is always enabled ([#15077](https://github.com/remix-run/react-router/pull/15077)) +- `@react-router/dev` - Removed the `future.unstable_previewServerPrerendering` flag and make prerendering with the Vite Environment API the default. ([#15077](https://github.com/remix-run/react-router/pull/15077)) +- `react-router` - Update `tsconfig.json` `target`/`lib` from `ES2020 -> ES2022` ([591853e](https://github.com/remix-run/react-router/commit/591853e)) +- `react-router` - Switch the published packages in `packages/` to ESM-only. ([#14895](https://github.com/remix-run/react-router/pull/14895)) ([59ebcf1](https://github.com/remix-run/react-router/commit/59ebcf1)) +- `react-router` - Remove deprecated `data` parameter in favor of `loaderData` for `meta` APIs (to align with `Route.ComponentProps`) ([#14931](https://github.com/remix-run/react-router/pull/14931)) + - `Route.MetaArgs`, `Route.MetaMatch`, `MetaArgs`, `MetaMatch`, `Route.ComponentProps.matches`, `UIMatch` +- `react-router` - Remove internal `hasErrorBoundary` field added to `router.routes` when using a data router ([#15074](https://github.com/remix-run/react-router/pull/15074)) + - This should not impact user-facing code since this was an internal prop and was computed based on the presence of `ErrorBoundary` or `errorElement` on your route + - `hasErrorBoundary` is no longer accepted on `RouteObject` (`IndexRouteObject`/`NonIndexRouteObject`), `DataRouteObject`, `` JSX props, or as a key in `lazy` route definitions. + - The `MapRoutePropertiesFunction` signature no longer requires returning `hasErrorBoundary`; the router infers it directly. +- `react-router` - Remove `react-router-dom` package ([#15076](https://github.com/remix-run/react-router/pull/15076)) + - In v7 everything DOM-specific was collapsed into `react-router/dom` + - `react-router-dom` was kept around as a convenience so existing v6 app imports would still work + - For v8, you will need to swap `react-router-dom` imports: + - `RouterProvider`/`HydratedRouter` should be imported from `react-router/dom` + - Everything else should be imported from `react-router` +- `@react-router/architect` - Bump `@architect/functions` to v8 ([#15106](https://github.com/remix-run/react-router/pull/15106)) +- `@react-router/architect` - Remove the `useRequestContextDomainName` option from `createRequestHandler` - this is now the default behavior ([#15188](https://github.com/remix-run/react-router/pull/15188)) +- `@react-router/dev` - Remove `@react-router/dev/vite/cloudflare` dev proxy export; use `@cloudflare/vite-plugin` instead ([#15077](https://github.com/remix-run/react-router/pull/15077)) + - Drops support for `wrangler@3` as a peer dependency of `@react-router/dev` +- `@react-router/dev` - Require Vite 7+ and make the Vite Environment API build path mandatory ([#15077](https://github.com/remix-run/react-router/pull/15077)) +- `@react-router/express` - Bump dependencies ([#15106](https://github.com/remix-run/react-router/pull/15106)) + - Bumped `express` from `^4.19.2` to `^4.22.2` + - Bumped the `express` peer dependency from `^4.17.1 || ^5` to `^4.22.2 || ^5` + - Bumped `@types/express` from `^4.17.9` to `^4.17.25` +- `@react-router/node` - Switch from `@mjackson/node-fetch-server` to `@remix-run/node-fetch-server` now that we can directly use ESM-only packages ([#14930](https://github.com/remix-run/react-router/pull/14930)) +- `@react-router/serve` - Switch from `@mjackson/node-fetch-server` to `@remix-run/node-fetch-server` now that we can directly use ESM-only packages ([#14930](https://github.com/remix-run/react-router/pull/14930)) +- `create-react-router` - Switch from `@remix-run/web-fetch` to native `fetch` internally. ([#14929](https://github.com/remix-run/react-router/pull/14929)) + - This removes the underlying `HTTPS_PROXY` support that `node-fetch` and subsequently `@remix-run/web-fetch` supported + +### Minor Changes + +- `react-router` - Bump dependencies ([#15080](https://github.com/remix-run/react-router/pull/15080)) + - Bumped `cookie` from `^1.0.1` to `^1.1.1` + - Bumped `set-cookie-parser` from `^2.6.0` to `^3.1.0` +- `@react-router/cloudflare` - Bump `@cloudflare/workers-types` fromn `^4.20260520.1` to `^4.20260527.1` ([#15106](https://github.com/remix-run/react-router/pull/15106)) +- `@react-router/dev` - Bump dependencies ([#15080](https://github.com/remix-run/react-router/pull/15080)) + - Bumped `@babel/core` from `^7.27.7` to `^7.29.7` + - Bumped `@babel/generator` from `^7.27.5` to `^7.29.7` + - Bumped `@babel/parser` from `^7.27.7` to `^7.29.7` + - Bumped `@babel/plugin-syntax-jsx` from `^7.27.1` to `^7.29.7` + - Bumped `@babel/preset-typescript` from `^7.27.1` to `^7.29.7` + - Bumped `@babel/traverse` from `^7.27.7` to `^7.29.7` + - Bumped `@babel/types` from `^7.27.7` to `^7.29.7` + - Bumped `dedent` from `^1.5.3` to `^1.7.2` + - Bumped `jsesc` from `3.0.2` to `3.1.0` + - Bumped `lodash` from `^4.17.21` to `^4.18.1` + - Bumped `prettier` from `^3.6.2` to `^3.8.3` + - Bumped `@remix-run/node-fetch-server` from `^0.13.0` to `^0.13.3` + - Bumped `react-refresh` from `^0.14.0` to `^0.18.0` + - Bumped `semver` from `^7.3.7` to `^7.8.1` + - Bumped `tinyglobby` from `^0.2.14` to `^0.2.16` + - Bumped `valibot` from `^1.2.0` to `^1.4.1` +- `@react-router/dev` - Replace `cookie` and `set-cookie-parser` with `cookie-es` ([#15109](https://github.com/remix-run/react-router/pull/15109)) +- `@react-router/dev` - Removed the `vite-node` dependency in favor of Vite's native module runner APIs ([#15104](https://github.com/remix-run/react-router/pull/15104)) +- `@react-router/serve` - Bump `express` from `4.21.2` to `5.2.1` ([#15101](https://github.com/remix-run/react-router/issues/15101)) +- `create-react-router` - Bump dependencies ([#15080](https://github.com/remix-run/react-router/pull/15080)) + - Bumped `execa` from `5.1.1` to `9.6.1` + - Bumped `log-update` from `^5.0.1` to `^8.0.0` + - Bumped `semver` from `^7.3.7` to `^7.8.1` + - Bumped `sort-package-json` from `^1.55.0` to `^3.6.1` + - Bumped `strip-ansi` from `^6.0.1` to `^7.2.0` + - Bumped `tar-fs` from `^2.1.3` to `^3.1.2` + +### Patch Changes + +- `react-router` - Ensure client middleware errors load lazy route error boundaries before bubbling ([#15086](https://github.com/remix-run/react-router/pull/15086)) +- `react-router` - Remove explicit `onSubmit` type override from `SharedFormProps` to fix deprecation warning with `@types/react@19.x` ([#14932](https://github.com/remix-run/react-router/pull/14932)) ([59ebcf1](https://github.com/remix-run/react-router/commit/59ebcf1)) +- `react-router` - Update package builds to preserve individual module files in published artifacts. Public APIs and documented import paths are unchanged. ([#15092](https://github.com/remix-run/react-router/pull/15092)) + - Updated package TypeScript configs to support modern module syntax used by the build configuration. +- `react-router` - Migrate package builds from `tsup` to `tsdown`. Published package entry points and public APIs are unchanged. ([#15092](https://github.com/remix-run/react-router/pull/15092)) +- `react-router` - Upgrade React Router's TypeScript tooling to TypeScript 6. Runtime behavior and public APIs are unchanged. ([#15092](https://github.com/remix-run/react-router/pull/15092)) +- `@react-router/architect` - Bump dependencies ([#15080](https://github.com/remix-run/react-router/pull/15080)) + - Bumped `@types/aws-lambda` from `^8.10.82` to `^8.10.161` +- `@react-router/dev` - Bump dependencies ([#15080](https://github.com/remix-run/react-router/pull/15080)) + - Bumped `@babel/core` from `^7.29.0` to `^7.29.7` + - Bumped `@babel/generator` from `^7.29.1` to `^7.29.7` + - Bumped `@babel/parser` from `^7.29.3` to `^7.29.7` + - Bumped `@babel/plugin-syntax-jsx` from `^7.28.6` to `^7.29.7` + - Bumped `@babel/preset-typescript` from `^7.28.5` to `^7.29.7` + - Bumped `@babel/traverse` from `^7.29.0` to `^7.29.7` + - Bumped `@babel/types` from `^7.29.0` to `^7.29.7` + - Bumped `babel-dead-code-elimination` from `^1.0.6` to `^1.0.12` + - Bumped `chokidar` from `^4.0.0` to `^5.0.0` + - Bumped `es-module-lexer` from `^1.3.1` to `^2.1.0` + - Bumped `exit-hook` from `2.2.1` to `5.1.0` + - Bumped `isbot` from `^5.1.11` to `^5.1.40` + - Bumped `p-map` from `^7.0.3` to `^7.0.4` + - Bumped `pathe` from `^1.1.2` to `^2.0.3` + - Bumped `pkg-types` from `^2.3.0` to `^2.3.1` + - Bumped `react-refresh` from `^0.14.0` to `^0.18.0` + - Bumped `semver` from `^7.8.0` to `^7.8.1` + - Bumped `tinyglobby` from `^0.2.14` to `^0.2.16` + - Bumped `valibot` from `^1.4.0` to `^1.4.1` +- `@react-router/dev` - Fix Windows libuv assertion (`!(handle->flags & UV_HANDLE_CLOSING)` in `src/win/async.c`) during prerendering by using `node:http` instead of `fetch` for internal prerender requests against the Vite preview server ([#15077](https://github.com/remix-run/react-router/pull/15077)) +- `@react-router/fs-routes` - Bump dependencies ([#15091](https://github.com/remix-run/react-router/pull/15091)) + - Bumped `minimatch` from `^9.0.0` to `^10.2.5` +- `@react-router/node` - Bump dependencies ([#15106](https://github.com/remix-run/react-router/pull/15106)) + - Bumped `@remix-run/node-fetch-server` from `^0.13.0` to `^0.13.3` +- `@react-router/serve` - Bump dependencies ([#15091](https://github.com/remix-run/react-router/pull/15091)) + - Bumped `@remix-run/node-fetch-server` from `^0.13.0` to `^0.13.3` + - Bumped `get-port` from `5.1.1` to `7.2.0` + +**Full Changelog**: [`v7.18.0...v8.0.0`](https://github.com/remix-run/react-router/compare/react-router@7.18.0...react-router@8.0.0) + +# React Router v7 Releases + ## v7.18.0 Date: 2026-06-16 diff --git a/README.md b/README.md index f634862dc7..8e1210841f 100644 --- a/README.md +++ b/README.md @@ -2,27 +2,30 @@ [npm-badge]: https://img.shields.io/npm/v/react-router.svg [npm]: https://www.npmjs.org/package/react-router -[build-badge]: https://img.shields.io/github/actions/workflow/status/remix-run/react-router/test.yml?branch=dev&style=square +[build-badge]: https://img.shields.io/github/actions/workflow/status/remix-run/react-router/test-unit.yml?branch=main&style=square [build]: https://github.com/remix-run/react-router/actions/workflows/test-unit.yml -React Router is a multi-strategy router for React bridging the gap from React 18 to React 19. You can use it maximally as a React framework or minimally as a library with your own architecture. +React Router is a multi-strategy router for React. You can use it maximally as a React framework or minimally as a library with your own architecture. - [Getting Started - Framework](https://reactrouter.com/start/framework/installation) - [Getting Started - Library](https://reactrouter.com/start/library/installation) -- [Upgrade from v6](https://reactrouter.com/upgrading/v6) -- [Upgrade from Remix](https://reactrouter.com/upgrading/remix) +- [Upgrade from v7](https://reactrouter.com/upgrading/v7) - [Changelog](https://github.com/remix-run/react-router/blob/main/CHANGELOG.md) ## Packages - [`react-router`](./packages/react-router) +- [`create-react-router`](./packages/create-react-router) - [`@react-router/dev`](./packages/react-router-dev) - [`@react-router/node`](./packages/react-router-node) -- [`@react-router/cloudflare`](./packages/react-router-cloudflare) - [`@react-router/serve`](./packages/react-router-serve) +- [`@react-router/express`](./packages/react-router-express) +- [`@react-router/architect`](./packages/react-router-architect) +- [`@react-router/cloudflare`](./packages/react-router-cloudflare) - [`@react-router/fs-routes`](./packages/react-router-fs-routes) ## Previous Versions +- [v7](https://reactrouter.com/v7) - [v6](https://reactrouter.com/v6) - [v5](https://v5.reactrouter.com/) diff --git a/docs/api/components/Await.md b/docs/api/components/Await.md index 0ff499af41..8b34c3a8e0 100644 --- a/docs/api/components/Await.md +++ b/docs/api/components/Await.md @@ -20,7 +20,7 @@ https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/co ## Summary -[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react-router.Await.html) +[Reference Documentation ↗](https://api.reactrouter.com/v8/functions/react-router.Await.html) Used to render promise values with automatic error handling. diff --git a/docs/api/components/Form.md b/docs/api/components/Form.md index 144d3eb596..15a016c564 100644 --- a/docs/api/components/Form.md +++ b/docs/api/components/Form.md @@ -20,7 +20,7 @@ https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/do ## Summary -[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react-router.Form.html) +[Reference Documentation ↗](https://api.reactrouter.com/v8/functions/react-router.Form.html) A progressively enhanced HTML [`
`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/form) that submits data to actions via [`fetch`](https://developer.mozilla.org/en-US/docs/Web/API/fetch), @@ -38,7 +38,7 @@ enabling web application user experiences. `Form` is most useful for submissions that should also change the URL or otherwise add an entry to the browser history stack. For forms that shouldn't manipulate the browser [`History`](https://developer.mozilla.org/en-US/docs/Web/API/History) -stack, use [``](https://api.reactrouter.com/v7/types/react-router.FetcherWithComponents.html#Form). +stack, use [``](https://api.reactrouter.com/v8/types/react-router.FetcherWithComponents.html#Form). ```tsx import { Form } from "react-router"; @@ -114,7 +114,7 @@ completion of the navigation when using the Determines whether the form action is relative to the route hierarchy or the pathname. Use this if you want to opt out of navigating the route hierarchy and want to instead route based on slash-delimited URL segments. -See [`RelativeRoutingType`](https://api.reactrouter.com/v7/types/react-router.RelativeRoutingType.html). +See [`RelativeRoutingType`](https://api.reactrouter.com/v8/types/react-router.RelativeRoutingType.html). ### reloadDocument diff --git a/docs/api/components/Link.md b/docs/api/components/Link.md index b5fb8517be..a56785981a 100644 --- a/docs/api/components/Link.md +++ b/docs/api/components/Link.md @@ -20,7 +20,7 @@ https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/do ## Summary -[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react-router.Link.html) +[Reference Documentation ↗](https://api.reactrouter.com/v8/functions/react-router.Link.html) A progressively enhanced [``](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a) wrapper to enable navigation with client-side routing. @@ -185,7 +185,7 @@ This state is inaccessible on the server as it is implemented on top of [modes: framework, data, declarative] -Can be a string or a partial [`Path`](https://api.reactrouter.com/v7/interfaces/react-router.Path.html): +Can be a string or a partial [`Path`](https://api.reactrouter.com/v8/interfaces/react-router.Path.html): ```tsx diff --git a/docs/api/components/Links.md b/docs/api/components/Links.md index 23bbc98ae5..cf90bccbd1 100644 --- a/docs/api/components/Links.md +++ b/docs/api/components/Links.md @@ -20,7 +20,7 @@ https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/do ## Summary -[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react-router.Links.html) +[Reference Documentation ↗](https://api.reactrouter.com/v8/functions/react-router.Links.html) Renders all the [``](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link) tags created by the route module's [`links`](../../start/framework/route-module#links) diff --git a/docs/api/components/Meta.md b/docs/api/components/Meta.md index 8cd1bffee7..0083294bf4 100644 --- a/docs/api/components/Meta.md +++ b/docs/api/components/Meta.md @@ -20,7 +20,7 @@ https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/do ## Summary -[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react-router.Meta.html) +[Reference Documentation ↗](https://api.reactrouter.com/v8/functions/react-router.Meta.html) Renders all the [``](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta) tags created by the route module's [`meta`](../../start/framework/route-module#meta) diff --git a/docs/api/components/NavLink.md b/docs/api/components/NavLink.md index 21672c7751..95c7f08a0f 100644 --- a/docs/api/components/NavLink.md +++ b/docs/api/components/NavLink.md @@ -20,19 +20,19 @@ https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/do ## Summary -[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react-router.NavLink.html) +[Reference Documentation ↗](https://api.reactrouter.com/v8/functions/react-router.NavLink.html) Wraps [``](../components/Link) with additional props for styling active and pending states. - Automatically applies classes to the link based on its `active` and `pending` -states, see [`NavLinkProps.className`](https://api.reactrouter.com/v7/interfaces/react-router.NavLinkProps.html#className) +states, see [`NavLinkProps.className`](https://api.reactrouter.com/v8/interfaces/react-router.NavLinkProps.html#className) - Note that `pending` is only available with Framework and Data modes. - Automatically applies `aria-current="page"` to the link when the link is active. See [`aria-current`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-current) on MDN. - States are additionally available through the className, style, and children -render props. See [`NavLinkRenderProps`](https://api.reactrouter.com/v7/types/react-router.NavLinkRenderProps.html). +render props. See [`NavLinkRenderProps`](https://api.reactrouter.com/v8/types/react-router.NavLinkRenderProps.html). ```tsx Messages @@ -94,7 +94,7 @@ a.transitioning { } ``` -Or you can specify a function that receives [`NavLinkRenderProps`](https://api.reactrouter.com/v7/types/react-router.NavLinkRenderProps.html) and +Or you can specify a function that receives [`NavLinkRenderProps`](https://api.reactrouter.com/v8/types/react-router.NavLinkRenderProps.html) and returns the `className`: ```tsx @@ -125,7 +125,7 @@ Defines the link [lazy route discovery](../../explanation/lazy-route-discovery) [modes: framework, data, declarative] Changes the matching logic for the `active` and `pending` states to only match -to the "end" of the [`NavLinkProps.to`](https://api.reactrouter.com/v7/interfaces/react-router.NavLinkProps.html#to). If the URL is longer, it will no +to the "end" of the [`NavLinkProps.to`](https://api.reactrouter.com/v8/interfaces/react-router.NavLinkProps.html#to). If the URL is longer, it will no longer be considered active. | Link | URL | isActive | @@ -269,7 +269,7 @@ This state is inaccessible on the server as it is implemented on top of [modes: framework, data, declarative] Styles can also be applied dynamically via a function that receives -[`NavLinkRenderProps`](https://api.reactrouter.com/v7/types/react-router.NavLinkRenderProps.html) and returns the styles: +[`NavLinkRenderProps`](https://api.reactrouter.com/v8/types/react-router.NavLinkRenderProps.html) and returns the styles: ```tsx @@ -284,7 +284,7 @@ Styles can also be applied dynamically via a function that receives [modes: framework, data, declarative] -Can be a string or a partial [`Path`](https://api.reactrouter.com/v7/interfaces/react-router.Path.html): +Can be a string or a partial [`Path`](https://api.reactrouter.com/v8/interfaces/react-router.Path.html): ```tsx diff --git a/docs/api/components/Navigate.md b/docs/api/components/Navigate.md index 71b6a3fdcd..b6652c9a0a 100644 --- a/docs/api/components/Navigate.md +++ b/docs/api/components/Navigate.md @@ -20,7 +20,7 @@ https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/co ## Summary -[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react-router.Navigate.html) +[Reference Documentation ↗](https://api.reactrouter.com/v8/functions/react-router.Navigate.html) A component-based version of [`useNavigate`](../hooks/useNavigate) to use in a [`React.Component` class](https://react.dev/reference/react/Component) where @@ -43,7 +43,7 @@ function Navigate({ to, replace, state, relative }: NavigateProps): null ### relative How to interpret relative routing in the `to` prop. -See [`RelativeRoutingType`](https://api.reactrouter.com/v7/types/react-router.RelativeRoutingType.html). +See [`RelativeRoutingType`](https://api.reactrouter.com/v8/types/react-router.RelativeRoutingType.html). ### replace @@ -52,9 +52,9 @@ stack ### state -State to pass to the new [`Location`](https://api.reactrouter.com/v7/interfaces/react-router.Location.html) to store in [`history.state`](https://developer.mozilla.org/en-US/docs/Web/API/History/state). +State to pass to the new [`Location`](https://api.reactrouter.com/v8/interfaces/react-router.Location.html) to store in [`history.state`](https://developer.mozilla.org/en-US/docs/Web/API/History/state). ### to -The path to navigate to. This can be a string or a [`Path`](https://api.reactrouter.com/v7/interfaces/react-router.Path.html) object +The path to navigate to. This can be a string or a [`Path`](https://api.reactrouter.com/v8/interfaces/react-router.Path.html) object diff --git a/docs/api/components/Outlet.md b/docs/api/components/Outlet.md index 51bd0da88c..aa48aeb0d8 100644 --- a/docs/api/components/Outlet.md +++ b/docs/api/components/Outlet.md @@ -20,7 +20,7 @@ https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/co ## Summary -[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react-router.Outlet.html) +[Reference Documentation ↗](https://api.reactrouter.com/v8/functions/react-router.Outlet.html) Renders the matching child route of a parent route or nothing if no child route matches. diff --git a/docs/api/components/PrefetchPageLinks.md b/docs/api/components/PrefetchPageLinks.md index 97c428a99b..c227fbbaa4 100644 --- a/docs/api/components/PrefetchPageLinks.md +++ b/docs/api/components/PrefetchPageLinks.md @@ -20,7 +20,7 @@ https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/do ## Summary -[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react-router.PrefetchPageLinks.html) +[Reference Documentation ↗](https://api.reactrouter.com/v8/functions/react-router.PrefetchPageLinks.html) Renders [``](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLinkElement/rel) tags for modules and data of another page to enable an instant navigation to diff --git a/docs/api/components/Route.md b/docs/api/components/Route.md index 0197fd3003..3bd41665e9 100644 --- a/docs/api/components/Route.md +++ b/docs/api/components/Route.md @@ -20,7 +20,7 @@ https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/co ## Summary -[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react-router.Route.html) +[Reference Documentation ↗](https://api.reactrouter.com/v8/functions/react-router.Route.html) Configures an element to render when a pattern matches the current location. It must be rendered within a [`Routes`](../components/Routes) element. Note that these routes @@ -114,7 +114,7 @@ Mutually exclusive with `HydrateFallback`. ### id -The unique identifier for this route (for use with [`DataRouter`](https://api.reactrouter.com/v7/interfaces/react-router.DataRouter.html)s) +The unique identifier for this route (for use with [`DataRouter`](https://api.reactrouter.com/v8/interfaces/react-router.DataRouter.html)s) ### index diff --git a/docs/api/components/Routes.md b/docs/api/components/Routes.md index 78f9d2ae5c..b829b642ce 100644 --- a/docs/api/components/Routes.md +++ b/docs/api/components/Routes.md @@ -20,7 +20,7 @@ https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/co ## Summary -[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react-router.Routes.html) +[Reference Documentation ↗](https://api.reactrouter.com/v8/functions/react-router.Routes.html) Renders a branch of [``s](../components/Route) that best matches the current location. Note that these routes do not participate in [data loading](../../start/framework/route-module#loader), @@ -54,5 +54,5 @@ Nested [`Route`](../components/Route) elements ### location -The [`Location`](https://api.reactrouter.com/v7/interfaces/react-router.Location.html) to match against. Defaults to the current location. +The [`Location`](https://api.reactrouter.com/v8/interfaces/react-router.Location.html) to match against. Defaults to the current location. diff --git a/docs/api/components/Scripts.md b/docs/api/components/Scripts.md index 5d733d0d9e..3f38ba1111 100644 --- a/docs/api/components/Scripts.md +++ b/docs/api/components/Scripts.md @@ -20,7 +20,7 @@ https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/do ## Summary -[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react-router.Scripts.html) +[Reference Documentation ↗](https://api.reactrouter.com/v8/functions/react-router.Scripts.html) Renders the client runtime of your app. It should be rendered inside the [``](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/body) diff --git a/docs/api/components/ScrollRestoration.md b/docs/api/components/ScrollRestoration.md index 19ee559643..6957299855 100644 --- a/docs/api/components/ScrollRestoration.md +++ b/docs/api/components/ScrollRestoration.md @@ -20,7 +20,7 @@ https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/do ## Summary -[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react-router.ScrollRestoration.html) +[Reference Documentation ↗](https://api.reactrouter.com/v8/functions/react-router.ScrollRestoration.html) Emulates the browser's scroll restoration on location changes. Apps should only render one of these, right before the [`Scripts`](../components/Scripts) component. @@ -65,7 +65,7 @@ function ScrollRestoration({ A function that returns a key to use for scroll restoration. This is useful for custom scroll restoration logic, such as using only the pathname so that later navigations to prior paths will restore the scroll. Defaults to -`location.key`. See [`GetScrollRestorationKeyFunction`](https://api.reactrouter.com/v7/interfaces/react-router.GetScrollRestorationKeyFunction.html). +`location.key`. See [`GetScrollRestorationKeyFunction`](https://api.reactrouter.com/v8/interfaces/react-router.GetScrollRestorationKeyFunction.html). ```tsx Promise) { ### opts.patchRoutesOnNavigation Lazily define portions of the route tree on navigations. -See [`PatchRoutesOnNavigationFunction`](https://api.reactrouter.com/v7/types/react-router.PatchRoutesOnNavigationFunction.html). +See [`PatchRoutesOnNavigationFunction`](https://api.reactrouter.com/v8/types/react-router.PatchRoutesOnNavigationFunction.html). By default, React Router wants you to provide a full route tree up front via `createBrowserRouter(routes)`. This allows React Router to perform synchronous @@ -530,5 +530,5 @@ override. Defaults to the global `window` instance. ## Returns -An initialized [data router](https://api.reactrouter.com/v7/interfaces/react-router.DataRouter.html) to pass to [``](../data-routers/RouterProvider) +An initialized [data router](https://api.reactrouter.com/v8/interfaces/react-router.DataRouter.html) to pass to [``](../data-routers/RouterProvider) diff --git a/docs/api/data-routers/createHashRouter.md b/docs/api/data-routers/createHashRouter.md index 6839d23c4f..33775b3666 100644 --- a/docs/api/data-routers/createHashRouter.md +++ b/docs/api/data-routers/createHashRouter.md @@ -20,9 +20,9 @@ https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/do ## Summary -[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react-router.createHashRouter.html) +[Reference Documentation ↗](https://api.reactrouter.com/v8/functions/react-router.createHashRouter.html) -Create a new [data router](https://api.reactrouter.com/v7/interfaces/react-router.DataRouter.html) that manages the application +Create a new [data router](https://api.reactrouter.com/v8/interfaces/react-router.DataRouter.html) that manages the application path via the URL [`hash`](https://developer.mozilla.org/en-US/docs/Web/API/URL/hash). Data Routers should not be held in React state. You should create your router @@ -82,7 +82,7 @@ function createBrowserRouter(routes, { When Server-Rendering and opting-out of automatic hydration, the `hydrationData` option allows you to pass in hydration data from your server-render. This will almost always be a subset of data from the -[`StaticHandlerContext`](https://api.reactrouter.com/v7/interfaces/react-router.StaticHandlerContext.html) value you get back from the [`StaticHandler`](https://api.reactrouter.com/v7/interfaces/react-router.StaticHandler.html)'s +[`StaticHandlerContext`](https://api.reactrouter.com/v8/interfaces/react-router.StaticHandlerContext.html) value you get back from the [`StaticHandler`](https://api.reactrouter.com/v8/interfaces/react-router.StaticHandler.html)'s `query` method: ```tsx @@ -227,7 +227,7 @@ let router = createBrowserRouter(routes, { ### opts.patchRoutesOnNavigation Lazily define portions of the route tree on navigations. -See [`PatchRoutesOnNavigationFunction`](https://api.reactrouter.com/v7/types/react-router.PatchRoutesOnNavigationFunction.html). +See [`PatchRoutesOnNavigationFunction`](https://api.reactrouter.com/v8/types/react-router.PatchRoutesOnNavigationFunction.html). By default, React Router wants you to provide a full route tree up front via `createBrowserRouter(routes)`. This allows React Router to perform synchronous @@ -529,5 +529,5 @@ override. Defaults to the global `window` instance. ## Returns -An initialized [data router](https://api.reactrouter.com/v7/interfaces/react-router.DataRouter.html) to pass to [``](../data-routers/RouterProvider) +An initialized [data router](https://api.reactrouter.com/v8/interfaces/react-router.DataRouter.html) to pass to [``](../data-routers/RouterProvider) diff --git a/docs/api/data-routers/createMemoryRouter.md b/docs/api/data-routers/createMemoryRouter.md index 51127ced82..06c6993756 100644 --- a/docs/api/data-routers/createMemoryRouter.md +++ b/docs/api/data-routers/createMemoryRouter.md @@ -20,9 +20,9 @@ https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/co ## Summary -[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react-router.createMemoryRouter.html) +[Reference Documentation ↗](https://api.reactrouter.com/v8/functions/react-router.createMemoryRouter.html) -Create a new [`DataRouter`](https://api.reactrouter.com/v7/interfaces/react-router.DataRouter.html) that manages the application path using an +Create a new [`DataRouter`](https://api.reactrouter.com/v8/interfaces/react-router.DataRouter.html) that manages the application path using an in-memory [`History`](https://developer.mozilla.org/en-US/docs/Web/API/History) stack. Useful for non-browser environments without a DOM API. @@ -158,5 +158,5 @@ Lazily define portions of the route tree on navigations. ## Returns -An initialized [`DataRouter`](https://api.reactrouter.com/v7/interfaces/react-router.DataRouter.html) to pass to [``](../data-routers/RouterProvider) +An initialized [`DataRouter`](https://api.reactrouter.com/v8/interfaces/react-router.DataRouter.html) to pass to [``](../data-routers/RouterProvider) diff --git a/docs/api/data-routers/createStaticHandler.md b/docs/api/data-routers/createStaticHandler.md index 6ca5755dce..c44dd7e87c 100644 --- a/docs/api/data-routers/createStaticHandler.md +++ b/docs/api/data-routers/createStaticHandler.md @@ -20,7 +20,7 @@ https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/ro ## Summary -[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react-router.createStaticHandler.html) +[Reference Documentation ↗](https://api.reactrouter.com/v8/functions/react-router.createStaticHandler.html) Create a static handler to perform server-side data loading @@ -54,7 +54,7 @@ function createStaticHandler( ### routes -The [route objects](https://api.reactrouter.com/v7/types/react-router.RouteObject.html) to create a static handler for +The [route objects](https://api.reactrouter.com/v8/types/react-router.RouteObject.html) to create a static handler for ### opts.basename diff --git a/docs/api/data-routers/createStaticRouter.md b/docs/api/data-routers/createStaticRouter.md index 7a5106b144..c7355f3921 100644 --- a/docs/api/data-routers/createStaticRouter.md +++ b/docs/api/data-routers/createStaticRouter.md @@ -20,9 +20,9 @@ https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/do ## Summary -[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react-router.createStaticRouter.html) +[Reference Documentation ↗](https://api.reactrouter.com/v8/functions/react-router.createStaticRouter.html) -Create a static [`DataRouter`](https://api.reactrouter.com/v7/interfaces/react-router.DataRouter.html) for server-side rendering +Create a static [`DataRouter`](https://api.reactrouter.com/v8/interfaces/react-router.DataRouter.html) for server-side rendering ```tsx export async function handleRequest(request: Request) { @@ -58,15 +58,15 @@ function createStaticRouter( ### routes -The route objects to create a static [`DataRouter`](https://api.reactrouter.com/v7/interfaces/react-router.DataRouter.html) for +The route objects to create a static [`DataRouter`](https://api.reactrouter.com/v8/interfaces/react-router.DataRouter.html) for ### context -The [`StaticHandlerContext`](https://api.reactrouter.com/v7/interfaces/react-router.StaticHandlerContext.html) returned from [`StaticHandler`](https://api.reactrouter.com/v7/interfaces/react-router.StaticHandler.html)'s `query` +The [`StaticHandlerContext`](https://api.reactrouter.com/v8/interfaces/react-router.StaticHandlerContext.html) returned from [`StaticHandler`](https://api.reactrouter.com/v8/interfaces/react-router.StaticHandler.html)'s `query` ### opts.future -Future flags for the static [`DataRouter`](https://api.reactrouter.com/v7/interfaces/react-router.DataRouter.html) +Future flags for the static [`DataRouter`](https://api.reactrouter.com/v8/interfaces/react-router.DataRouter.html) ### opts.branches @@ -74,5 +74,5 @@ Optional pre-computed route branches ## Returns -A static [`DataRouter`](https://api.reactrouter.com/v7/interfaces/react-router.DataRouter.html) that can be used to render the provided routes +A static [`DataRouter`](https://api.reactrouter.com/v8/interfaces/react-router.DataRouter.html) that can be used to render the provided routes diff --git a/docs/api/declarative-routers/BrowserRouter.md b/docs/api/declarative-routers/BrowserRouter.md index 8515cee98f..128be90979 100644 --- a/docs/api/declarative-routers/BrowserRouter.md +++ b/docs/api/declarative-routers/BrowserRouter.md @@ -20,7 +20,7 @@ https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/do ## Summary -[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react-router.BrowserRouter.html) +[Reference Documentation ↗](https://api.reactrouter.com/v8/functions/react-router.BrowserRouter.html) A declarative [``](../declarative-routers/Router) using the browser [`History`](https://developer.mozilla.org/en-US/docs/Web/API/History) API for client-side routing. diff --git a/docs/api/declarative-routers/HashRouter.md b/docs/api/declarative-routers/HashRouter.md index 0a899a7658..0d73d19f94 100644 --- a/docs/api/declarative-routers/HashRouter.md +++ b/docs/api/declarative-routers/HashRouter.md @@ -20,7 +20,7 @@ https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/do ## Summary -[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react-router.HashRouter.html) +[Reference Documentation ↗](https://api.reactrouter.com/v8/functions/react-router.HashRouter.html) A declarative [``](../declarative-routers/Router) that stores the location in the [`hash`](https://developer.mozilla.org/en-US/docs/Web/API/URL/hash) portion diff --git a/docs/api/declarative-routers/HistoryRouter.md b/docs/api/declarative-routers/HistoryRouter.md index 5a7a99665c..d3d5ae05f9 100644 --- a/docs/api/declarative-routers/HistoryRouter.md +++ b/docs/api/declarative-routers/HistoryRouter.md @@ -28,7 +28,7 @@ to release notes for relevant changes. ## Summary -[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react-router.unstable_HistoryRouter.html) +[Reference Documentation ↗](https://api.reactrouter.com/v8/functions/react-router.unstable_HistoryRouter.html) A declarative [``](../declarative-routers/Router) that accepts a pre-instantiated `history` object. diff --git a/docs/api/declarative-routers/MemoryRouter.md b/docs/api/declarative-routers/MemoryRouter.md index ddd57f09c8..846888782a 100644 --- a/docs/api/declarative-routers/MemoryRouter.md +++ b/docs/api/declarative-routers/MemoryRouter.md @@ -20,7 +20,7 @@ https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/co ## Summary -[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react-router.MemoryRouter.html) +[Reference Documentation ↗](https://api.reactrouter.com/v8/functions/react-router.MemoryRouter.html) A declarative [``](../declarative-routers/Router) that stores all entries in memory. diff --git a/docs/api/declarative-routers/Router.md b/docs/api/declarative-routers/Router.md index 1f4f587dcc..6b7593b958 100644 --- a/docs/api/declarative-routers/Router.md +++ b/docs/api/declarative-routers/Router.md @@ -20,7 +20,7 @@ https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/co ## Summary -[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react-router.Router.html) +[Reference Documentation ↗](https://api.reactrouter.com/v8/functions/react-router.Router.html) Provides location context for the rest of the app. @@ -55,7 +55,7 @@ Nested [`Route`](../components/Route) elements describing the route tree ### location The location to match against. Defaults to the current location. -This can be a string or a [`Location`](https://api.reactrouter.com/v7/interfaces/react-router.Location.html) object. +This can be a string or a [`Location`](https://api.reactrouter.com/v8/interfaces/react-router.Location.html) object. ### navigationType @@ -65,7 +65,7 @@ Defaults to `NavigationType.Pop`. ### navigator The navigator to use for navigation. This is usually a history object -or a custom navigator that implements the [`Navigator`](https://api.reactrouter.com/v7/interfaces/react-router.Navigator.html) interface. +or a custom navigator that implements the [`Navigator`](https://api.reactrouter.com/v8/interfaces/react-router.Navigator.html) interface. ### static diff --git a/docs/api/declarative-routers/StaticRouter.md b/docs/api/declarative-routers/StaticRouter.md index 2ffc3595a3..0f4a7f95de 100644 --- a/docs/api/declarative-routers/StaticRouter.md +++ b/docs/api/declarative-routers/StaticRouter.md @@ -20,9 +20,9 @@ https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/do ## Summary -[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react-router.StaticRouter.html) +[Reference Documentation ↗](https://api.reactrouter.com/v8/functions/react-router.StaticRouter.html) -A [``](../declarative-routers/Router) that may not navigate to any other [`Location`](https://api.reactrouter.com/v7/interfaces/react-router.Location.html). +A [``](../declarative-routers/Router) that may not navigate to any other [`Location`](https://api.reactrouter.com/v8/interfaces/react-router.Location.html). This is useful on the server where there is no stateful UI. ## Signature @@ -47,5 +47,5 @@ The child elements to render inside the static router ### location -The [`Location`](https://api.reactrouter.com/v7/interfaces/react-router.Location.html) to render the static router at (default: `/`) +The [`Location`](https://api.reactrouter.com/v8/interfaces/react-router.Location.html) to render the static router at (default: `/`) diff --git a/docs/api/framework-routers/ServerRouter.md b/docs/api/framework-routers/ServerRouter.md index 6a1bcbe3fa..499554524b 100644 --- a/docs/api/framework-routers/ServerRouter.md +++ b/docs/api/framework-routers/ServerRouter.md @@ -20,7 +20,7 @@ https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/do ## Summary -[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react-router.ServerRouter.html) +[Reference Documentation ↗](https://api.reactrouter.com/v8/functions/react-router.ServerRouter.html) The server entry point for a React Router app in Framework Mode. This component is used to generate the HTML in the response from the server. See diff --git a/docs/api/hooks/useActionData.md b/docs/api/hooks/useActionData.md index 0093675fc6..3b38e616cb 100644 --- a/docs/api/hooks/useActionData.md +++ b/docs/api/hooks/useActionData.md @@ -20,7 +20,7 @@ https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/ho ## Summary -[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react-router.useActionData.html) +[Reference Documentation ↗](https://api.reactrouter.com/v8/functions/react-router.useActionData.html) Returns the [`action`](../../start/framework/route-module#action) data from the most recent `POST` navigation form submission or `undefined` if there diff --git a/docs/api/hooks/useAsyncError.md b/docs/api/hooks/useAsyncError.md index f1569b4d65..469f24ffec 100644 --- a/docs/api/hooks/useAsyncError.md +++ b/docs/api/hooks/useAsyncError.md @@ -20,7 +20,7 @@ https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/ho ## Summary -[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react-router.useAsyncError.html) +[Reference Documentation ↗](https://api.reactrouter.com/v8/functions/react-router.useAsyncError.html) Returns the rejection value from the closest [``](../components/Await). diff --git a/docs/api/hooks/useAsyncValue.md b/docs/api/hooks/useAsyncValue.md index 6b0cef859e..fd99d69bb3 100644 --- a/docs/api/hooks/useAsyncValue.md +++ b/docs/api/hooks/useAsyncValue.md @@ -20,7 +20,7 @@ https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/ho ## Summary -[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react-router.useAsyncValue.html) +[Reference Documentation ↗](https://api.reactrouter.com/v8/functions/react-router.useAsyncValue.html) Returns the resolved promise value from the closest [``](../components/Await). diff --git a/docs/api/hooks/useBeforeUnload.md b/docs/api/hooks/useBeforeUnload.md index 2b050edbc8..f8bca7e49d 100644 --- a/docs/api/hooks/useBeforeUnload.md +++ b/docs/api/hooks/useBeforeUnload.md @@ -20,7 +20,7 @@ https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/do ## Summary -[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react-router.useBeforeUnload.html) +[Reference Documentation ↗](https://api.reactrouter.com/v8/functions/react-router.useBeforeUnload.html) Set up a callback to be fired on [Window's `beforeunload` event](https://developer.mozilla.org/en-US/docs/Web/API/Window/beforeunload_event). diff --git a/docs/api/hooks/useBlocker.md b/docs/api/hooks/useBlocker.md index 5a47c421e7..a537ba5dbb 100644 --- a/docs/api/hooks/useBlocker.md +++ b/docs/api/hooks/useBlocker.md @@ -20,21 +20,21 @@ https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/ho ## Summary -[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react-router.useBlocker.html) +[Reference Documentation ↗](https://api.reactrouter.com/v8/functions/react-router.useBlocker.html) Allow the application to block navigations within the SPA and present the user a confirmation dialog to confirm the navigation. Mostly used to avoid using half-filled form data. This does not handle hard-reloads or cross-origin navigations. -The [`Blocker`](https://api.reactrouter.com/v7/types/react-router.Blocker.html) object returned by the hook has the following properties: +The [`Blocker`](https://api.reactrouter.com/v8/types/react-router.Blocker.html) object returned by the hook has the following properties: - **`state`** - `unblocked` - the blocker is idle and has not prevented any navigation - `blocked` - the blocker has prevented a navigation - `proceeding` - the blocker is proceeding through from a blocked navigation - **`location`** - - When in a `blocked` state, this represents the [`Location`](https://api.reactrouter.com/v7/interfaces/react-router.Location.html) to which + - When in a `blocked` state, this represents the [`Location`](https://api.reactrouter.com/v8/interfaces/react-router.Location.html) to which we blocked a navigation. When in a `proceeding` state, this is the location being navigated to after a `blocker.proceed()` call. - **`proceed()`** @@ -73,7 +73,7 @@ receives a single object parameter containing the `currentLocation`, ## Returns -A [`Blocker`](https://api.reactrouter.com/v7/types/react-router.Blocker.html) object with state and reset functionality +A [`Blocker`](https://api.reactrouter.com/v8/types/react-router.Blocker.html) object with state and reset functionality ## Examples diff --git a/docs/api/hooks/useFetcher.md b/docs/api/hooks/useFetcher.md index 425195b93c..d70bf01543 100644 --- a/docs/api/hooks/useFetcher.md +++ b/docs/api/hooks/useFetcher.md @@ -20,7 +20,7 @@ https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/do ## Summary -[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react-router.useFetcher.html) +[Reference Documentation ↗](https://api.reactrouter.com/v8/functions/react-router.useFetcher.html) Useful for creating complex, dynamic user interfaces that require multiple, concurrent data interactions without causing a navigation. @@ -93,5 +93,5 @@ function AnotherComp() { ## Returns -A [`FetcherWithComponents`](https://api.reactrouter.com/v7/types/react-router.FetcherWithComponents.html) object that contains the fetcher's state, data, and components for submitting forms and loading data. +A [`FetcherWithComponents`](https://api.reactrouter.com/v8/types/react-router.FetcherWithComponents.html) object that contains the fetcher's state, data, and components for submitting forms and loading data. diff --git a/docs/api/hooks/useFetchers.md b/docs/api/hooks/useFetchers.md index fa8ef87698..c9c40969c5 100644 --- a/docs/api/hooks/useFetchers.md +++ b/docs/api/hooks/useFetchers.md @@ -20,9 +20,9 @@ https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/do ## Summary -[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react-router.useFetchers.html) +[Reference Documentation ↗](https://api.reactrouter.com/v8/functions/react-router.useFetchers.html) -Returns an array of all in-flight [`Fetcher`](https://api.reactrouter.com/v7/types/react-router.Fetcher.html)s. This is useful for components +Returns an array of all in-flight [`Fetcher`](https://api.reactrouter.com/v8/types/react-router.Fetcher.html)s. This is useful for components throughout the app that didn't create the fetchers but want to use their submissions to participate in optimistic UI. @@ -47,6 +47,6 @@ function useFetchers(): (Fetcher & { ## Returns -An array of all in-flight [`Fetcher`](https://api.reactrouter.com/v7/types/react-router.Fetcher.html)s, each with a unique `key` +An array of all in-flight [`Fetcher`](https://api.reactrouter.com/v8/types/react-router.Fetcher.html)s, each with a unique `key` property. diff --git a/docs/api/hooks/useFormAction.md b/docs/api/hooks/useFormAction.md index 5c43bfe53f..70f306db52 100644 --- a/docs/api/hooks/useFormAction.md +++ b/docs/api/hooks/useFormAction.md @@ -20,7 +20,7 @@ https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/do ## Summary -[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react-router.useFormAction.html) +[Reference Documentation ↗](https://api.reactrouter.com/v8/functions/react-router.useFormAction.html) Resolves the URL to the closest route in the component hierarchy instead of the current URL of the app. diff --git a/docs/api/hooks/useHref.md b/docs/api/hooks/useHref.md index 35a52c6515..bebe1a2378 100644 --- a/docs/api/hooks/useHref.md +++ b/docs/api/hooks/useHref.md @@ -20,9 +20,9 @@ https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/ho ## Summary -[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react-router.useHref.html) +[Reference Documentation ↗](https://api.reactrouter.com/v8/functions/react-router.useHref.html) -Resolves a URL against the current [`Location`](https://api.reactrouter.com/v7/interfaces/react-router.Location.html). +Resolves a URL against the current [`Location`](https://api.reactrouter.com/v8/interfaces/react-router.Location.html). ```tsx import { useHref } from "react-router"; diff --git a/docs/api/hooks/useInRouterContext.md b/docs/api/hooks/useInRouterContext.md index dcf163e7c6..fa36bb1606 100644 --- a/docs/api/hooks/useInRouterContext.md +++ b/docs/api/hooks/useInRouterContext.md @@ -20,7 +20,7 @@ https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/ho ## Summary -[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react-router.useInRouterContext.html) +[Reference Documentation ↗](https://api.reactrouter.com/v8/functions/react-router.useInRouterContext.html) Returns `true` if this component is a descendant of a [`Router`](../declarative-routers/Router), useful to ensure a component is used within a [`Router`](../declarative-routers/Router). diff --git a/docs/api/hooks/useLinkClickHandler.md b/docs/api/hooks/useLinkClickHandler.md index 88740c66ae..6f7a7a019d 100644 --- a/docs/api/hooks/useLinkClickHandler.md +++ b/docs/api/hooks/useLinkClickHandler.md @@ -20,7 +20,7 @@ https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/do ## Summary -[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react-router.useLinkClickHandler.html) +[Reference Documentation ↗](https://api.reactrouter.com/v8/functions/react-router.useLinkClickHandler.html) Handles the click behavior for router [``](../components/Link) components.This is useful if you need to create custom [``](../components/Link) components with @@ -59,7 +59,7 @@ function useLinkClickHandler( ### to -The URL to navigate to, can be a string or a partial [`Path`](https://api.reactrouter.com/v7/interfaces/react-router.Path.html). +The URL to navigate to, can be a string or a partial [`Path`](https://api.reactrouter.com/v8/interfaces/react-router.Path.html). ### options.preventScrollReset @@ -68,7 +68,7 @@ using the [`ScrollRestoration`](../components/ScrollRestoration) component. Defa ### options.relative -The [relative routing type](https://api.reactrouter.com/v7/types/react-router.RelativeRoutingType.html) to use for the link. Defaults to `"route"`. +The [relative routing type](https://api.reactrouter.com/v8/types/react-router.RelativeRoutingType.html) to use for the link. Defaults to `"route"`. ### options.replace diff --git a/docs/api/hooks/useLoaderData.md b/docs/api/hooks/useLoaderData.md index 0d04fa9093..214caee535 100644 --- a/docs/api/hooks/useLoaderData.md +++ b/docs/api/hooks/useLoaderData.md @@ -20,7 +20,7 @@ https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/ho ## Summary -[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react-router.useLoaderData.html) +[Reference Documentation ↗](https://api.reactrouter.com/v8/functions/react-router.useLoaderData.html) Returns the data from the closest route [`loader`](../../start/framework/route-module#loader) or diff --git a/docs/api/hooks/useLocation.md b/docs/api/hooks/useLocation.md index d2c4ca04cc..87aad1a2a0 100644 --- a/docs/api/hooks/useLocation.md +++ b/docs/api/hooks/useLocation.md @@ -20,9 +20,9 @@ https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/ho ## Summary -[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react-router.useLocation.html) +[Reference Documentation ↗](https://api.reactrouter.com/v8/functions/react-router.useLocation.html) -Returns the current [`Location`](https://api.reactrouter.com/v7/interfaces/react-router.Location.html). This can be useful if you'd like to +Returns the current [`Location`](https://api.reactrouter.com/v8/interfaces/react-router.Location.html). This can be useful if you'd like to perform some side effect whenever it changes. ```tsx @@ -51,5 +51,5 @@ function useLocation(): Location ## Returns -The current [`Location`](https://api.reactrouter.com/v7/interfaces/react-router.Location.html) object +The current [`Location`](https://api.reactrouter.com/v8/interfaces/react-router.Location.html) object diff --git a/docs/api/hooks/useMatch.md b/docs/api/hooks/useMatch.md index ef48934833..d5a05210ae 100644 --- a/docs/api/hooks/useMatch.md +++ b/docs/api/hooks/useMatch.md @@ -20,9 +20,9 @@ https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/ho ## Summary -[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react-router.useMatch.html) +[Reference Documentation ↗](https://api.reactrouter.com/v8/functions/react-router.useMatch.html) -Returns a [`PathMatch`](https://api.reactrouter.com/v7/interfaces/react-router.PathMatch.html) object if the given pattern matches the current URL. +Returns a [`PathMatch`](https://api.reactrouter.com/v8/interfaces/react-router.PathMatch.html) object if the given pattern matches the current URL. This is useful for components that need to know "active" state, e.g. [``](../components/NavLink). @@ -38,7 +38,7 @@ function useMatch( ### pattern -The pattern to match against the current [`Location`](https://api.reactrouter.com/v7/interfaces/react-router.Location.html) +The pattern to match against the current [`Location`](https://api.reactrouter.com/v8/interfaces/react-router.Location.html) ## Returns diff --git a/docs/api/hooks/useMatches.md b/docs/api/hooks/useMatches.md index 78357c3298..0fa0f79181 100644 --- a/docs/api/hooks/useMatches.md +++ b/docs/api/hooks/useMatches.md @@ -20,7 +20,7 @@ https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/ho ## Summary -[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react-router.useMatches.html) +[Reference Documentation ↗](https://api.reactrouter.com/v8/functions/react-router.useMatches.html) Returns the active route matches, useful for accessing `loaderData` for parent/child routes or the route [`handle`](../../start/framework/route-module#handle) @@ -34,5 +34,5 @@ function useMatches(): UIMatch[] ## Returns -An array of [UI matches](https://api.reactrouter.com/v7/interfaces/react-router.UIMatch.html) for the current route hierarchy +An array of [UI matches](https://api.reactrouter.com/v8/interfaces/react-router.UIMatch.html) for the current route hierarchy diff --git a/docs/api/hooks/useNavigate.md b/docs/api/hooks/useNavigate.md index 4a1afe21cb..b2a98d2a79 100644 --- a/docs/api/hooks/useNavigate.md +++ b/docs/api/hooks/useNavigate.md @@ -20,7 +20,7 @@ https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/ho ## Summary -[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react-router.useNavigate.html) +[Reference Documentation ↗](https://api.reactrouter.com/v8/functions/react-router.useNavigate.html) Returns a function that lets you navigate programmatically in the browser in response to user interactions or effects. @@ -30,12 +30,12 @@ functions than this hook. The returned function signature is `navigate(to, options?)`/`navigate(delta)` where: -* `to` can be a string path, a [`To`](https://api.reactrouter.com/v7/types/react-router.To.html) object, or a number (delta) +* `to` can be a string path, a [`To`](https://api.reactrouter.com/v8/types/react-router.To.html) object, or a number (delta) * `options` contains options for modifying the navigation * These options work in all modes (Framework, Data, and Declarative): * `relative`: `"route"` or `"path"` to control relative routing logic * `replace`: Replace the current entry in the [`History`](https://developer.mozilla.org/en-US/docs/Web/API/History) stack - * `state`: Optional [`history.state`](https://developer.mozilla.org/en-US/docs/Web/API/History/state) to include with the new [`Location`](https://api.reactrouter.com/v7/interfaces/react-router.Location.html) + * `state`: Optional [`history.state`](https://developer.mozilla.org/en-US/docs/Web/API/History/state) to include with the new [`Location`](https://api.reactrouter.com/v8/interfaces/react-router.Location.html) * These options only work in Framework and Data modes: * `flushSync`: Wrap the DOM updates in [`ReactDom.flushSync`](https://react.dev/reference/react-dom/flushSync) * `preventScrollReset`: Do not scroll back to the top of the page after navigation @@ -73,7 +73,7 @@ navigate("/some/route"); navigate("/some/route?search=param"); ``` -### Navigate with a [`To`](https://api.reactrouter.com/v7/types/react-router.To.html) object +### Navigate with a [`To`](https://api.reactrouter.com/v8/types/react-router.To.html) object All properties are optional. @@ -86,7 +86,7 @@ navigate({ }); ``` -If you use `state`, that will be available on the [`Location`](https://api.reactrouter.com/v7/interfaces/react-router.Location.html) object on +If you use `state`, that will be available on the [`Location`](https://api.reactrouter.com/v8/interfaces/react-router.Location.html) object on the next page. Access it with `useLocation().state` (see [`useLocation`](../hooks/useLocation)). ### Navigate back or forward in the history stack diff --git a/docs/api/hooks/useNavigation.md b/docs/api/hooks/useNavigation.md index d02ab9fabd..1f1e560dbc 100644 --- a/docs/api/hooks/useNavigation.md +++ b/docs/api/hooks/useNavigation.md @@ -20,9 +20,9 @@ https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/ho ## Summary -[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react-router.useNavigation.html) +[Reference Documentation ↗](https://api.reactrouter.com/v8/functions/react-router.useNavigation.html) -Returns the current [`Navigation`](https://api.reactrouter.com/v7/types/react-router.Navigation.html), defaulting to an "idle" navigation +Returns the current [`Navigation`](https://api.reactrouter.com/v8/types/react-router.Navigation.html), defaulting to an "idle" navigation when no navigation is in progress. You can use this to render pending UI (like a global spinner) or read [`FormData`](https://developer.mozilla.org/en-US/docs/Web/API/FormData) from a form navigation. @@ -46,5 +46,5 @@ function useNavigation(): UseNavigationResult ## Returns -The current [`Navigation`](https://api.reactrouter.com/v7/types/react-router.Navigation.html) object +The current [`Navigation`](https://api.reactrouter.com/v8/types/react-router.Navigation.html) object diff --git a/docs/api/hooks/useNavigationType.md b/docs/api/hooks/useNavigationType.md index 12fd04cae5..a2ac2c690e 100644 --- a/docs/api/hooks/useNavigationType.md +++ b/docs/api/hooks/useNavigationType.md @@ -20,10 +20,10 @@ https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/ho ## Summary -[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react-router.useNavigationType.html) +[Reference Documentation ↗](https://api.reactrouter.com/v8/functions/react-router.useNavigationType.html) -Returns the current [`Navigation`](https://api.reactrouter.com/v7/types/react-router.Navigation.html) action which describes how the router -came to the current [`Location`](https://api.reactrouter.com/v7/interfaces/react-router.Location.html), either by a pop, push, or replace on +Returns the current [`Navigation`](https://api.reactrouter.com/v8/types/react-router.Navigation.html) action which describes how the router +came to the current [`Location`](https://api.reactrouter.com/v8/interfaces/react-router.Location.html), either by a pop, push, or replace on the [`History`](https://developer.mozilla.org/en-US/docs/Web/API/History) stack. ## Signature @@ -34,5 +34,5 @@ function useNavigationType(): NavigationType ## Returns -The current [`NavigationType`](https://api.reactrouter.com/v7/enums/react-router.NavigationType.html) (`"POP"`, `"PUSH"`, or `"REPLACE"`) +The current [`NavigationType`](https://api.reactrouter.com/v8/enums/react-router.NavigationType.html) (`"POP"`, `"PUSH"`, or `"REPLACE"`) diff --git a/docs/api/hooks/useOutlet.md b/docs/api/hooks/useOutlet.md index f2826dcc58..3a59d789bb 100644 --- a/docs/api/hooks/useOutlet.md +++ b/docs/api/hooks/useOutlet.md @@ -20,7 +20,7 @@ https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/ho ## Summary -[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react-router.useOutlet.html) +[Reference Documentation ↗](https://api.reactrouter.com/v8/functions/react-router.useOutlet.html) Returns the element for the child route at this level of the route hierarchy. Used internally by [``](../components/Outlet) to render child diff --git a/docs/api/hooks/useOutletContext.md b/docs/api/hooks/useOutletContext.md index 35a7c15675..481f4449cd 100644 --- a/docs/api/hooks/useOutletContext.md +++ b/docs/api/hooks/useOutletContext.md @@ -20,7 +20,7 @@ https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/ho ## Summary -[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react-router.useOutletContext.html) +[Reference Documentation ↗](https://api.reactrouter.com/v8/functions/react-router.useOutletContext.html) Returns the parent route [``](../components/Outlet). diff --git a/docs/api/hooks/useParams.md b/docs/api/hooks/useParams.md index 4e143c3a70..4accb28045 100644 --- a/docs/api/hooks/useParams.md +++ b/docs/api/hooks/useParams.md @@ -20,7 +20,7 @@ https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/ho ## Summary -[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react-router.useParams.html) +[Reference Documentation ↗](https://api.reactrouter.com/v8/functions/react-router.useParams.html) Returns an object of key/value-pairs of the dynamic params from the current URL that were matched by the routes. Child routes inherit all params from diff --git a/docs/api/hooks/usePrompt.md b/docs/api/hooks/usePrompt.md index 7ac11f0d4b..aa1c14ae36 100644 --- a/docs/api/hooks/usePrompt.md +++ b/docs/api/hooks/usePrompt.md @@ -28,7 +28,7 @@ to release notes for relevant changes. ## Summary -[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react-router.unstable_usePrompt.html) +[Reference Documentation ↗](https://api.reactrouter.com/v8/functions/react-router.unstable_usePrompt.html) Wrapper around [`useBlocker`](../hooks/useBlocker) to show a [`window.confirm`](https://developer.mozilla.org/en-US/docs/Web/API/Window/confirm) prompt to users instead of building a custom UI with [`useBlocker`](../hooks/useBlocker). diff --git a/docs/api/hooks/useResolvedPath.md b/docs/api/hooks/useResolvedPath.md index 268efc8c96..dd1cb54c69 100644 --- a/docs/api/hooks/useResolvedPath.md +++ b/docs/api/hooks/useResolvedPath.md @@ -20,11 +20,11 @@ https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/ho ## Summary -[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react-router.useResolvedPath.html) +[Reference Documentation ↗](https://api.reactrouter.com/v8/functions/react-router.useResolvedPath.html) Resolves the pathname of the given `to` value against the current -[`Location`](https://api.reactrouter.com/v7/interfaces/react-router.Location.html). Similar to [`useHref`](../hooks/useHref), but returns a -[`Path`](https://api.reactrouter.com/v7/interfaces/react-router.Path.html) instead of a string. +[`Location`](https://api.reactrouter.com/v8/interfaces/react-router.Location.html). Similar to [`useHref`](../hooks/useHref), but returns a +[`Path`](https://api.reactrouter.com/v8/interfaces/react-router.Path.html) instead of a string. ```tsx import { useResolvedPath } from "react-router"; @@ -63,5 +63,5 @@ Defaults to `"route"` so routing is relative to the route tree. ## Returns -The resolved [`Path`](https://api.reactrouter.com/v7/interfaces/react-router.Path.html) object with `pathname`, `search`, and `hash` +The resolved [`Path`](https://api.reactrouter.com/v8/interfaces/react-router.Path.html) object with `pathname`, `search`, and `hash` diff --git a/docs/api/hooks/useRevalidator.md b/docs/api/hooks/useRevalidator.md index bfd87f622a..1f9dbe3ad1 100644 --- a/docs/api/hooks/useRevalidator.md +++ b/docs/api/hooks/useRevalidator.md @@ -20,7 +20,7 @@ https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/ho ## Summary -[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react-router.useRevalidator.html) +[Reference Documentation ↗](https://api.reactrouter.com/v8/functions/react-router.useRevalidator.html) Revalidate the data on the page for reasons outside of normal data mutations like [`Window` focus](https://developer.mozilla.org/en-US/docs/Web/API/Window/focus_event) diff --git a/docs/api/hooks/useRouteError.md b/docs/api/hooks/useRouteError.md index 07026f1cf4..fa4684badc 100644 --- a/docs/api/hooks/useRouteError.md +++ b/docs/api/hooks/useRouteError.md @@ -20,7 +20,7 @@ https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/ho ## Summary -[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react-router.useRouteError.html) +[Reference Documentation ↗](https://api.reactrouter.com/v8/functions/react-router.useRouteError.html) Accesses the error thrown during an [`action`](../../start/framework/route-module#action), diff --git a/docs/api/hooks/useRouteLoaderData.md b/docs/api/hooks/useRouteLoaderData.md index ce59b69161..bd1fe3a719 100644 --- a/docs/api/hooks/useRouteLoaderData.md +++ b/docs/api/hooks/useRouteLoaderData.md @@ -20,7 +20,7 @@ https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/ho ## Summary -[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react-router.useRouteLoaderData.html) +[Reference Documentation ↗](https://api.reactrouter.com/v8/functions/react-router.useRouteLoaderData.html) Returns the [`loader`](../../start/framework/route-module#loader) data for a given route by route ID. diff --git a/docs/api/hooks/useRouterState.md b/docs/api/hooks/useRouterState.md index 7e0f979f84..115dce8e7a 100644 --- a/docs/api/hooks/useRouterState.md +++ b/docs/api/hooks/useRouterState.md @@ -28,7 +28,7 @@ to release notes for relevant changes. ## Summary -[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react-router.unstable_useRouterState.html) +[Reference Documentation ↗](https://api.reactrouter.com/v8/functions/react-router.unstable_useRouterState.html) A unified hook for reading router state: current (`active`) and in-flight (`pending`) locations, search params, params, matches, and navigation type. diff --git a/docs/api/hooks/useRoutes.md b/docs/api/hooks/useRoutes.md index ca7d74dabd..4091eb3888 100644 --- a/docs/api/hooks/useRoutes.md +++ b/docs/api/hooks/useRoutes.md @@ -20,7 +20,7 @@ https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/ho ## Summary -[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react-router.useRoutes.html) +[Reference Documentation ↗](https://api.reactrouter.com/v8/functions/react-router.useRoutes.html) Hook version of [``](../components/Routes) that uses objects instead of components. These objects have the same properties as the component props. @@ -63,11 +63,11 @@ function useRoutes( ### routes -An array of [`RouteObject`](https://api.reactrouter.com/v7/types/react-router.RouteObject.html)s that define the route hierarchy +An array of [`RouteObject`](https://api.reactrouter.com/v8/types/react-router.RouteObject.html)s that define the route hierarchy ### locationArg -An optional [`Location`](https://api.reactrouter.com/v7/interfaces/react-router.Location.html) object or pathname string to use instead of the current [`Location`](https://api.reactrouter.com/v7/interfaces/react-router.Location.html) +An optional [`Location`](https://api.reactrouter.com/v8/interfaces/react-router.Location.html) object or pathname string to use instead of the current [`Location`](https://api.reactrouter.com/v8/interfaces/react-router.Location.html) ## Returns diff --git a/docs/api/hooks/useSearchParams.md b/docs/api/hooks/useSearchParams.md index 3a96e7f63b..55a9e6a26b 100644 --- a/docs/api/hooks/useSearchParams.md +++ b/docs/api/hooks/useSearchParams.md @@ -20,7 +20,7 @@ https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/do ## Summary -[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react-router.useSearchParams.html) +[Reference Documentation ↗](https://api.reactrouter.com/v8/functions/react-router.useSearchParams.html) Returns a tuple of the current URL's [`URLSearchParams`](https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams) and a function to update them. Setting the search params causes a navigation. diff --git a/docs/api/hooks/useSubmit.md b/docs/api/hooks/useSubmit.md index 11d5c2c04c..10df816135 100644 --- a/docs/api/hooks/useSubmit.md +++ b/docs/api/hooks/useSubmit.md @@ -20,7 +20,7 @@ https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/do ## Summary -[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react-router.useSubmit.html) +[Reference Documentation ↗](https://api.reactrouter.com/v8/functions/react-router.useSubmit.html) The imperative version of [``](../components/Form) that lets you submit a form from code instead of a user interaction. diff --git a/docs/api/hooks/useViewTransitionState.md b/docs/api/hooks/useViewTransitionState.md index 35f80b7c8c..8fd50bb5f6 100644 --- a/docs/api/hooks/useViewTransitionState.md +++ b/docs/api/hooks/useViewTransitionState.md @@ -20,13 +20,13 @@ https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/do ## Summary -[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react-router.useViewTransitionState.html) +[Reference Documentation ↗](https://api.reactrouter.com/v8/functions/react-router.useViewTransitionState.html) This hook returns `true` when there is an active [View Transition](https://developer.mozilla.org/en-US/docs/Web/API/View_Transitions_API) and the specified location matches either side of the navigation (the URL you are navigating **to** or the URL you are navigating **from**). This can be used to apply finer-grained styles to elements to further customize the view transition. This requires that view -transitions have been enabled for the given navigation via [`LinkProps.viewTransition`](https://api.reactrouter.com/v7/interfaces/react-router.LinkProps.html#viewTransition) +transitions have been enabled for the given navigation via [`LinkProps.viewTransition`](https://api.reactrouter.com/v8/interfaces/react-router.LinkProps.html#viewTransition) (or the `Form`, `submit`, or `navigate` call) ## Signature @@ -46,11 +46,11 @@ function useViewTransitionState( ### to -The [`To`](https://api.reactrouter.com/v7/types/react-router.To.html) location to compare against the active transition's current and next URLs. +The [`To`](https://api.reactrouter.com/v8/types/react-router.To.html) location to compare against the active transition's current and next URLs. ### options.relative -The relative routing type to use when resolving the `to` location, defaults to `"route"`. See [`RelativeRoutingType`](https://api.reactrouter.com/v7/types/react-router.RelativeRoutingType.html) for +The relative routing type to use when resolving the `to` location, defaults to `"route"`. See [`RelativeRoutingType`](https://api.reactrouter.com/v8/types/react-router.RelativeRoutingType.html) for more details. ## Returns diff --git a/docs/api/other-api/adapter.md b/docs/api/other-api/adapter.md index 66869e2638..3cefc85ee2 100644 --- a/docs/api/other-api/adapter.md +++ b/docs/api/other-api/adapter.md @@ -179,12 +179,18 @@ While not a direct "adapter" like the above, this package contains utilities for React Router officially supports all versions of [**Active** LTS][node-releases] and the latest minor line of [**Maintenance** LTS][node-releases] at any given point in time. +For example, at the time of this writing (6/17/2026): + +- Node 24 is in _Active LTS_ status, so React Router officially supports all `24.x` versions +- Node 22 is in _Maintenance LTS_ status and the latest release is `22.22.3`, so React Router officially supports all `22.22.x` versions + We make this distinction for Maintenance LTS for 2 reasons: - When security patches are released for old maintenance lines, we want to be able to bump our minimum supported versions - This better allows us to adopt new features shipped in Active LTS and backported to Maintenance LTS and keep our implementations aligned Updating the minimum supported Maintenance LTS **minor** version may be done in a React Router **minor** release. + Dropping support for an EOL Node **major** version will always be done in a React Router **major** release. [express]: https://expressjs.com diff --git a/docs/api/rsc/RSCHydratedRouter.md b/docs/api/rsc/RSCHydratedRouter.md index 059a1d8696..138957db27 100644 --- a/docs/api/rsc/RSCHydratedRouter.md +++ b/docs/api/rsc/RSCHydratedRouter.md @@ -28,7 +28,7 @@ to release notes for relevant changes. ## Summary -Hydrates a server rendered [`unstable_RSCPayload`](https://api.reactrouter.com/v7/types/react-router.unstable_RSCPayload.html) in the browser. +Hydrates a server rendered [`unstable_RSCPayload`](https://api.reactrouter.com/v8/types/react-router.unstable_RSCPayload.html) in the browser. ```tsx import { startTransition, StrictMode } from "react"; @@ -87,5 +87,5 @@ navigation or fetcher call. ### payload -The decoded [`unstable_RSCPayload`](https://api.reactrouter.com/v7/types/react-router.unstable_RSCPayload.html) to hydrate. +The decoded [`unstable_RSCPayload`](https://api.reactrouter.com/v8/types/react-router.unstable_RSCPayload.html) to hydrate. diff --git a/docs/api/rsc/RSCStaticRouter.md b/docs/api/rsc/RSCStaticRouter.md index e771d881a1..e402d1d507 100644 --- a/docs/api/rsc/RSCStaticRouter.md +++ b/docs/api/rsc/RSCStaticRouter.md @@ -28,9 +28,9 @@ to release notes for relevant changes. ## Summary -[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react-router.unstable_RSCStaticRouter.html) +[Reference Documentation ↗](https://api.reactrouter.com/v8/functions/react-router.unstable_RSCStaticRouter.html) -Pre-renders an [`unstable_RSCPayload`](https://api.reactrouter.com/v7/types/react-router.unstable_RSCPayload.html) to HTML. Usually used in +Pre-renders an [`unstable_RSCPayload`](https://api.reactrouter.com/v8/types/react-router.unstable_RSCPayload.html) to HTML. Usually used in [`unstable_routeRSCServerRequest`](../rsc/routeRSCServerRequest)'s `renderHTML` callback. ```tsx @@ -69,6 +69,6 @@ function RSCStaticRouter({ getPayload }: RSCStaticRouterProps) ### getPayload -A function that starts decoding of the [`unstable_RSCPayload`](https://api.reactrouter.com/v7/types/react-router.unstable_RSCPayload.html). Usually passed +A function that starts decoding of the [`unstable_RSCPayload`](https://api.reactrouter.com/v8/types/react-router.unstable_RSCPayload.html). Usually passed through from [`unstable_routeRSCServerRequest`](../rsc/routeRSCServerRequest)'s `renderHTML`. diff --git a/docs/api/rsc/matchRSCServerRequest.md b/docs/api/rsc/matchRSCServerRequest.md index 7493ad46ba..f140225600 100644 --- a/docs/api/rsc/matchRSCServerRequest.md +++ b/docs/api/rsc/matchRSCServerRequest.md @@ -28,12 +28,12 @@ to release notes for relevant changes. ## Summary -[Reference Documentation ↗](https://api.reactrouter.com/v7/variables/react-router.unstable_matchRSCServerRequest.html) +[Reference Documentation ↗](https://api.reactrouter.com/v8/variables/react-router.unstable_matchRSCServerRequest.html) Matches the given routes to a [`Request`](https://developer.mozilla.org/en-US/docs/Web/API/Request) and returns an [RSC](https://react.dev/reference/rsc/server-components) [`Response`](https://developer.mozilla.org/en-US/docs/Web/API/Response) -encoding an [`unstable_RSCPayload`](https://api.reactrouter.com/v7/types/react-router.unstable_RSCPayload.html) for consumption by an [RSC](https://react.dev/reference/rsc/server-components) +encoding an [`unstable_RSCPayload`](https://api.reactrouter.com/v8/types/react-router.unstable_RSCPayload.html) for consumption by an [RSC](https://react.dev/reference/rsc/server-components) enabled client router. ```tsx @@ -141,7 +141,7 @@ implementation for invocation by the router. ### opts.generateResponse A function responsible for using your `renderToReadableStream` to generate a [`Response`](https://developer.mozilla.org/en-US/docs/Web/API/Response) -encoding the [`unstable_RSCPayload`](https://api.reactrouter.com/v7/types/react-router.unstable_RSCPayload.html). +encoding the [`unstable_RSCPayload`](https://api.reactrouter.com/v8/types/react-router.unstable_RSCPayload.html). ### opts.loadServerAction @@ -166,7 +166,7 @@ The route discovery configuration, used to determine how the router should disco ### opts.routes -Your [route definitions](https://api.reactrouter.com/v7/types/react-router.unstable_RSCRouteConfigEntry.html). +Your [route definitions](https://api.reactrouter.com/v8/types/react-router.unstable_RSCRouteConfigEntry.html). ## Returns diff --git a/docs/api/rsc/routeRSCServerRequest.md b/docs/api/rsc/routeRSCServerRequest.md index edca45f9b2..3f716940e6 100644 --- a/docs/api/rsc/routeRSCServerRequest.md +++ b/docs/api/rsc/routeRSCServerRequest.md @@ -28,7 +28,7 @@ to release notes for relevant changes. ## Summary -[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react-router.unstable_routeRSCServerRequest.html) +[Reference Documentation ↗](https://api.reactrouter.com/v8/functions/react-router.unstable_routeRSCServerRequest.html) Routes the incoming [`Request`](https://developer.mozilla.org/en-US/docs/Web/API/Request) to the [RSC](https://react.dev/reference/rsc/server-components) server and @@ -93,7 +93,7 @@ Your `react-server-dom-xyz/client`'s `createFromReadableStream` function, used t ### opts.serverResponse -A Response or partial response generated by the [RSC](https://react.dev/reference/rsc/server-components) handler containing a serialized [`unstable_RSCPayload`](https://api.reactrouter.com/v7/types/react-router.unstable_RSCPayload.html). +A Response or partial response generated by the [RSC](https://react.dev/reference/rsc/server-components) handler containing a serialized [`unstable_RSCPayload`](https://api.reactrouter.com/v8/types/react-router.unstable_RSCPayload.html). ### opts.hydrate @@ -101,7 +101,7 @@ Whether to hydrate the server response with the RSC payload. Defaults to `true`. ### opts.renderHTML -A function that renders the [`unstable_RSCPayload`](https://api.reactrouter.com/v7/types/react-router.unstable_RSCPayload.html) to HTML, usually using a [``](../rsc/RSCStaticRouter). +A function that renders the [`unstable_RSCPayload`](https://api.reactrouter.com/v8/types/react-router.unstable_RSCPayload.html) to HTML, usually using a [``](../rsc/RSCStaticRouter). ### opts.request diff --git a/docs/api/utils/RouterContextProvider.md b/docs/api/utils/RouterContextProvider.md index 71ca03f190..1e69d291d6 100644 --- a/docs/api/utils/RouterContextProvider.md +++ b/docs/api/utils/RouterContextProvider.md @@ -20,7 +20,7 @@ https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/ro ## Summary -[Reference Documentation ↗](https://api.reactrouter.com/v7/classes/react-router.RouterContextProvider.html) +[Reference Documentation ↗](https://api.reactrouter.com/v8/classes/react-router.RouterContextProvider.html) Provides methods for writing/reading values in application context in a type-safe way. Primarily for usage with [middleware](../../how-to/middleware). diff --git a/docs/api/utils/createContext.md b/docs/api/utils/createContext.md index 6849643dfc..6168c43f08 100644 --- a/docs/api/utils/createContext.md +++ b/docs/api/utils/createContext.md @@ -20,9 +20,9 @@ https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/ro ## Summary -[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react-router.createContext.html) +[Reference Documentation ↗](https://api.reactrouter.com/v8/functions/react-router.createContext.html) -Creates a type-safe [`RouterContext`](https://api.reactrouter.com/v7/interfaces/react-router.RouterContext.html) object that can be used to +Creates a type-safe [`RouterContext`](https://api.reactrouter.com/v8/interfaces/react-router.RouterContext.html) object that can be used to store and retrieve arbitrary values in [`action`](../../start/framework/route-module#action)s, [`loader`](../../start/framework/route-module#loader)s, and [middleware](../../how-to/middleware). Similar to React's [`createContext`](https://react.dev/reference/react/createContext), @@ -83,7 +83,7 @@ An optional default value for the context. This value will be returned if no val ## Returns -A [`RouterContext`](https://api.reactrouter.com/v7/interfaces/react-router.RouterContext.html) object that can be used with +A [`RouterContext`](https://api.reactrouter.com/v8/interfaces/react-router.RouterContext.html) object that can be used with `context.get()` and `context.set()` in [`action`](../../start/framework/route-module#action)s, [`loader`](../../start/framework/route-module#loader)s, and [middleware](../../how-to/middleware). diff --git a/docs/api/utils/createRoutesFromElements.md b/docs/api/utils/createRoutesFromElements.md index fb05580ed2..6a11d7f0af 100644 --- a/docs/api/utils/createRoutesFromElements.md +++ b/docs/api/utils/createRoutesFromElements.md @@ -20,7 +20,7 @@ https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/co ## Summary -[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react-router.createRoutesFromElements.html) +[Reference Documentation ↗](https://api.reactrouter.com/v8/functions/react-router.createRoutesFromElements.html) Create route objects from JSX elements instead of arrays of objects. @@ -53,5 +53,5 @@ application developer. ## Returns -An array of [`RouteObject`](https://api.reactrouter.com/v7/types/react-router.RouteObject.html)s that can be used with a [`DataRouter`](https://api.reactrouter.com/v7/interfaces/react-router.DataRouter.html) +An array of [`RouteObject`](https://api.reactrouter.com/v8/types/react-router.RouteObject.html)s that can be used with a [`DataRouter`](https://api.reactrouter.com/v8/interfaces/react-router.DataRouter.html) diff --git a/docs/api/utils/data.md b/docs/api/utils/data.md index e9bbbda6bb..9fa5b05d73 100644 --- a/docs/api/utils/data.md +++ b/docs/api/utils/data.md @@ -20,7 +20,7 @@ https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/ro ## Summary -[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react-router.data.html) +[Reference Documentation ↗](https://api.reactrouter.com/v8/functions/react-router.data.html) Create "responses" that contain `headers`/`status` without forcing serialization into an actual [`Response`](https://developer.mozilla.org/en-US/docs/Web/API/Response) diff --git a/docs/api/utils/generatePath.md b/docs/api/utils/generatePath.md index 44069b9bf7..70e46c4597 100644 --- a/docs/api/utils/generatePath.md +++ b/docs/api/utils/generatePath.md @@ -20,7 +20,7 @@ https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/ro ## Summary -[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react-router.generatePath.html) +[Reference Documentation ↗](https://api.reactrouter.com/v8/functions/react-router.generatePath.html) Returns a path with params interpolated. diff --git a/docs/api/utils/isRouteErrorResponse.md b/docs/api/utils/isRouteErrorResponse.md index ca8d61f3a1..55a6a6ab14 100644 --- a/docs/api/utils/isRouteErrorResponse.md +++ b/docs/api/utils/isRouteErrorResponse.md @@ -20,9 +20,9 @@ https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/ro ## Summary -[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react-router.isRouteErrorResponse.html) +[Reference Documentation ↗](https://api.reactrouter.com/v8/functions/react-router.isRouteErrorResponse.html) -Check if the given error is an [`ErrorResponse`](https://api.reactrouter.com/v7/types/react-router.ErrorResponse.html) generated from a 4xx/5xx +Check if the given error is an [`ErrorResponse`](https://api.reactrouter.com/v8/types/react-router.ErrorResponse.html) generated from a 4xx/5xx [`Response`](https://developer.mozilla.org/en-US/docs/Web/API/Response) thrown from an [`action`](../../start/framework/route-module#action) or [`loader`](../../start/framework/route-module#loader) function. @@ -60,5 +60,5 @@ The error to check. ## Returns -`true` if the error is an [`ErrorResponse`](https://api.reactrouter.com/v7/types/react-router.ErrorResponse.html), `false` otherwise. +`true` if the error is an [`ErrorResponse`](https://api.reactrouter.com/v8/types/react-router.ErrorResponse.html), `false` otherwise. diff --git a/docs/api/utils/matchPath.md b/docs/api/utils/matchPath.md index 3996c5c0cc..1e15e717dd 100644 --- a/docs/api/utils/matchPath.md +++ b/docs/api/utils/matchPath.md @@ -20,7 +20,7 @@ https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/ro ## Summary -[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react-router.matchPath.html) +[Reference Documentation ↗](https://api.reactrouter.com/v8/functions/react-router.matchPath.html) Performs pattern matching on a URL pathname and returns information about the match. @@ -38,7 +38,7 @@ function matchPath( ### pattern -The pattern to match against the URL pathname. This can be a string or a [`PathPattern`](https://api.reactrouter.com/v7/interfaces/react-router.PathPattern.html) object. If a string is provided, it will be +The pattern to match against the URL pathname. This can be a string or a [`PathPattern`](https://api.reactrouter.com/v8/interfaces/react-router.PathPattern.html) object. If a string is provided, it will be treated as a pattern with `caseSensitive` set to `false` and `end` set to `true`. diff --git a/docs/api/utils/matchRoutes.md b/docs/api/utils/matchRoutes.md index 7c31862bc7..8dff74b828 100644 --- a/docs/api/utils/matchRoutes.md +++ b/docs/api/utils/matchRoutes.md @@ -20,7 +20,7 @@ https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/ro ## Summary -[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react-router.matchRoutes.html) +[Reference Documentation ↗](https://api.reactrouter.com/v8/functions/react-router.matchRoutes.html) Matches the given routes to a location and returns the match data. @@ -57,7 +57,7 @@ The array of route objects to match against. ### locationArg -The location to match against, either a string path or a partial [`Location`](https://api.reactrouter.com/v7/interfaces/react-router.Location.html) object +The location to match against, either a string path or a partial [`Location`](https://api.reactrouter.com/v8/interfaces/react-router.Location.html) object ### basename diff --git a/docs/api/utils/redirect.md b/docs/api/utils/redirect.md index 8174996790..f6955e38dc 100644 --- a/docs/api/utils/redirect.md +++ b/docs/api/utils/redirect.md @@ -20,7 +20,7 @@ https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/ro ## Summary -[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react-router.redirect.html) +[Reference Documentation ↗](https://api.reactrouter.com/v8/functions/react-router.redirect.html) A redirect [`Response`](https://developer.mozilla.org/en-US/docs/Web/API/Response). Sets the status code and the [`Location`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Location) diff --git a/docs/api/utils/redirectDocument.md b/docs/api/utils/redirectDocument.md index 7bf06bb861..fe7b85e660 100644 --- a/docs/api/utils/redirectDocument.md +++ b/docs/api/utils/redirectDocument.md @@ -20,7 +20,7 @@ https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/ro ## Summary -[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react-router.redirectDocument.html) +[Reference Documentation ↗](https://api.reactrouter.com/v8/functions/react-router.redirectDocument.html) A redirect [`Response`](https://developer.mozilla.org/en-US/docs/Web/API/Response) that will force a document reload to the new location. Sets the status code diff --git a/docs/api/utils/renderMatches.md b/docs/api/utils/renderMatches.md index f88815ac7a..5f6fcf64ab 100644 --- a/docs/api/utils/renderMatches.md +++ b/docs/api/utils/renderMatches.md @@ -20,7 +20,7 @@ https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/co ## Summary -[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react-router.renderMatches.html) +[Reference Documentation ↗](https://api.reactrouter.com/v8/functions/react-router.renderMatches.html) Renders the result of [`matchRoutes`](../utils/matchRoutes) into a React element. @@ -36,7 +36,7 @@ function renderMatches( ### matches -The array of [route matches](https://api.reactrouter.com/v7/interfaces/react-router.RouteMatch.html) to render +The array of [route matches](https://api.reactrouter.com/v8/interfaces/react-router.RouteMatch.html) to render ## Returns diff --git a/docs/api/utils/replace.md b/docs/api/utils/replace.md index 5f6285dfdb..f5486bb053 100644 --- a/docs/api/utils/replace.md +++ b/docs/api/utils/replace.md @@ -20,7 +20,7 @@ https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/ro ## Summary -[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react-router.replace.html) +[Reference Documentation ↗](https://api.reactrouter.com/v8/functions/react-router.replace.html) A redirect [`Response`](https://developer.mozilla.org/en-US/docs/Web/API/Response) that will perform a [`history.replaceState`](https://developer.mozilla.org/en-US/docs/Web/API/History/replaceState) diff --git a/docs/api/utils/resolvePath.md b/docs/api/utils/resolvePath.md index 8b2e980ca7..56a7de3fee 100644 --- a/docs/api/utils/resolvePath.md +++ b/docs/api/utils/resolvePath.md @@ -20,9 +20,9 @@ https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/ro ## Summary -[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react-router.resolvePath.html) +[Reference Documentation ↗](https://api.reactrouter.com/v8/functions/react-router.resolvePath.html) -Returns a resolved [`Path`](https://api.reactrouter.com/v7/interfaces/react-router.Path.html) object relative to the given pathname. +Returns a resolved [`Path`](https://api.reactrouter.com/v8/interfaces/react-router.Path.html) object relative to the given pathname. ## Signature @@ -34,7 +34,7 @@ function resolvePath(to: To, fromPathname = "/"): Path ### to -The path to resolve, either a string or a partial [`Path`](https://api.reactrouter.com/v7/interfaces/react-router.Path.html) object. +The path to resolve, either a string or a partial [`Path`](https://api.reactrouter.com/v8/interfaces/react-router.Path.html) object. ### fromPathname @@ -42,5 +42,5 @@ The pathname to resolve the path from. Defaults to `/`. ## Returns -A [`Path`](https://api.reactrouter.com/v7/interfaces/react-router.Path.html) object with the resolved pathname, search, and hash. +A [`Path`](https://api.reactrouter.com/v8/interfaces/react-router.Path.html) object with the resolved pathname, search, and hash. diff --git a/docs/how-to/middleware.md b/docs/how-to/middleware.md index 0efa02f787..7a25e98e82 100644 --- a/docs/how-to/middleware.md +++ b/docs/how-to/middleware.md @@ -91,24 +91,18 @@ export default function Dashboard({ } ``` -### 3. Update your `getLoadContext` function (if applicable) +### 3. Add a `getLoadContext` function (if applicable) -If you're using a custom server and a `getLoadContext` function, you will need to update your implementation to return an instance of [`RouterContextProvider`][RouterContextProvider], instead of a JavaScript object: +If you're using a custom server, you can use a `getLoadContext` function to pass information to into the react router handlers: -```diff -+import { -+ createContext, -+ RouterContextProvider, -+} from "react-router"; -import { createDb } from "./db"; - -+const dbContext = createContext(); +```tsx +import { RouterContextProvider } from "react-router"; +import { dbContext, createDb } from "./db"; function getLoadContext(req, res) { -- return { db: createDb() }; -+ const context = new RouterContextProvider(); -+ context.set(dbContext, createDb()); -+ return context; + const context = new RouterContextProvider(); + context.set(dbContext, createDb()); + return context; } ``` @@ -474,72 +468,6 @@ export const middleware: Route.MiddlewareFunction[] = [ Which `ErrorBoundary` is rendered will differ based on whether your middleware threw _before_ or _after_ calling then `next()` function. If it throws _after_ then it will bubble up from the throwing route just like a normal loader error because we've already run the loaders and have the appropriate `loaderData` to render in the route components. However, if an error is thrown _before_ calling `next()`, then we haven't called any loaders yet and there is no `loaderData` available. When this happens, we must bubble up to the highest route with a `loader` and start looking for an `ErrorBoundary` there. We cannot render any route components at that level or below without any `loaderData`. -## Changes to `getLoadContext`/`AppLoadContext` - -This only applies if you are using a custom server and a custom `getLoadContext` function - -Middleware introduces a breaking change to the `context` parameter generated by `getLoadContext` and passed to your `action`s and `loader`s. The current approach of a module-augmented `AppLoadContext` isn't really type-safe and instead just sort of tells TypeScript to "trust me". - -Middleware needs an equivalent `context` on the client for `clientMiddleware`, but we didn't want to duplicate this pattern from the server that we already weren't thrilled with, so we decided to introduce a new API where we could tackle type-safety. - -When opting into middleware, the `context` parameter changes to an instance of [`RouterContextProvider`][RouterContextProvider]: - -```ts -let dbContext = createContext(); -let context = new RouterContextProvider(); -context.set(dbContext, getDb()); -// ^ type-safe -let db = context.get(dbContext); -// ^ Database -``` - -If you're using a custom server and a `getLoadContext` function, you will need to update your implementation to return an instance of [`RouterContextProvider`][RouterContextProvider], instead of a plain JavaScript object: - -```diff -+import { -+ createContext, -+ RouterContextProvider, -+} from "react-router"; -import { createDb } from "./db"; - -+const dbContext = createContext(); - -function getLoadContext(req, res) { -- return { db: createDb() }; -+ const context = new RouterContextProvider(); -+ context.set(dbContext, createDb()); -+ return context; -} -``` - -### Migration from `AppLoadContext` - -If you're currently using `AppLoadContext`, you can migrate incrementally by using your existing module augmentation to augment [`RouterContextProvider`][RouterContextProvider] instead of `AppLoadContext`. Then, update your `getLoadContext` function to return an instance of [`RouterContextProvider`][RouterContextProvider]: - -```diff -declare module "react-router" { -- interface AppLoadContext { -+ interface RouterContextProvider { - db: Database; - user: User; - } -} - -function getLoadContext() { - const loadContext = {...}; -- return loadContext; -+ let context = new RouterContextProvider(); -+ Object.assign(context, loadContext); -+ return context; -} -``` - -This allows you to leave your `action`s/`loader`s untouched during initial adoption of middleware, since they can still read values directly (i.e., `context.db`). - -This approach is only intended to be used as a migration strategy when adopting middleware in React Router v7, allowing you to incrementally migrate to `context.set`/`context.get`. It is not safe to assume this approach will work in the next major version of React Router. - -The [`RouterContextProvider`][RouterContextProvider] class is also used for the client-side `context` parameter via `` and ``. Since `AppLoadContext` is primarily intended as a hand-off from your HTTP server into the React Router handlers, you need to be aware that these augmented fields will not be available in `clientMiddleware`, `clientLoader`, or `clientAction` functions even thought TypeScript will tell you they are (unless, of course, you provide the fields via `getContext` on the client). - ## Common Patterns ### Authentication @@ -700,24 +628,15 @@ export async function loader({ } ``` -[future-flags]: ../upgrading/future [Response]: https://developer.mozilla.org/en-US/docs/Web/API/Response [common-patterns]: #common-patterns [server-client]: #server-vs-client-middleware -[create-browser-router]: ../api/data-routers/createBrowserRouter -[create-hash-router]: ../api/data-routers/createHashRouter -[create-memory-router]: ../api/data-routers/createMemoryRouter -[create-static-handler]: ../api/data-routers/createStaticHandler [framework-action]: ../start/framework/route-module#action [framework-loader]: ../start/framework/route-module#loader -[getloadcontext]: #changes-to-getloadcontextapploadcontext [datastrategy]: ../api/data-routers/createBrowserRouter#optsdatastrategy [cms-redirect]: #cms-redirect-on-404 [createContext]: ../api/utils/createContext -[RouterContextProvider]: ../api/utils/RouterContextProvider [getContext]: ../api/data-routers/createBrowserRouter#optsgetContext -[window]: https://developer.mozilla.org/en-US/docs/Web/API/Window -[document]: https://developer.mozilla.org/en-US/docs/Web/API/Document [request]: https://developer.mozilla.org/en-US/docs/Web/API/Request [data-action]: ../start/data/route-object#action [data-loader]: ../start/data/route-object#loader diff --git a/docs/index.md b/docs/index.md index 6ed4d9e026..b0d4027331 100644 --- a/docs/index.md +++ b/docs/index.md @@ -5,7 +5,7 @@ order: 1 # React Router Home -React Router is a multi-strategy router for React bridging the gap from React 18 to React 19. You can use it maximally as a React framework or as minimally as you want. +React Router is a multi-strategy router for React. You can use it maximally as a React framework or as minimally as you want. ## Getting Started @@ -29,11 +29,8 @@ These icons indicate which mode the content is relevant to. Additional auto-generated reference documentation is available: -[Autogenerated Reference Docs ↗](https://api.reactrouter.com/v7/) +[Autogenerated Reference Docs ↗](https://api.reactrouter.com/v8/) ## Upgrading -If you are caught up on future flags, upgrading from React Router v6 or Remix v2 is generally non-breaking. Remix v2 apps are encouraged to upgrade to React Router v7. - -- [Upgrade from v6](./upgrading/v6) -- [Upgrade from Remix](./upgrading/remix) +If you are caught up on future flags, [upgrading from React Router v7](./upgrading/v7) is generally non-breaking. diff --git a/docs/start/framework/deploying.md b/docs/start/framework/deploying.md index 8597b4e36e..16194ef1cc 100644 --- a/docs/start/framework/deploying.md +++ b/docs/start/framework/deploying.md @@ -97,4 +97,4 @@ EdgeOne Pages maintains their own template for React Router. Checkout the [EdgeO ### DeployHQ -DeployHQ maintains their own guide for deploying React Router v7 to your own server. Checkout the [DeployHQ Guide](https://www.deployhq.com/guides/deploy-react-router-from-github) for more information. +DeployHQ maintains their own guide for deploying React Router to your own server. Checkout the [DeployHQ Guide](https://www.deployhq.com/guides/deploy-react-router-from-github) for more information. diff --git a/docs/start/modes.md b/docs/start/modes.md index 3614a27aba..963ebacf60 100644 --- a/docs/start/modes.md +++ b/docs/start/modes.md @@ -98,7 +98,6 @@ Every mode supports any architecture and deployment target, so the question isn' - are considering Next.js, Solid Start, SvelteKit, Astro, TanStack Start, etc. and want to compare - just want to build something with React - might want to server render, might not -- are coming from Remix (React Router v7 is the "next version" after Remix v2) - are migrating from Next.js [→ Get Started with Framework Mode](./framework/installation). @@ -113,7 +112,7 @@ Every mode supports any architecture and deployment target, so the question isn' **Use Declarative Mode if you:** - want to use React Router as simply as possible -- are coming from v6 and are happy with the `` +- are coming from earlier React Router versions and are happy with the `` - have a data layer that either skips pending states (like local first, background data replication/sync) or has its own abstractions for them - are coming from Create React App (you may want to consider framework mode though) diff --git a/packages/create-react-router/.changes/major.switch-remixrunwebfetch-native-fetch.md b/packages/create-react-router/.changes/major.switch-remixrunwebfetch-native-fetch.md deleted file mode 100644 index 4c3b7f8de4..0000000000 --- a/packages/create-react-router/.changes/major.switch-remixrunwebfetch-native-fetch.md +++ /dev/null @@ -1,3 +0,0 @@ -Switch from `@remix-run/web-fetch` to native `fetch` internally. - -- This removes the underlying `HTTPS_PROXY` support that `node-fetch` and subsequently `@remix-run/web-fetch` supported diff --git a/packages/create-react-router/.changes/major.update-minimum-node-version-2222.md b/packages/create-react-router/.changes/major.update-minimum-node-version-2222.md deleted file mode 100644 index e98fc3460f..0000000000 --- a/packages/create-react-router/.changes/major.update-minimum-node-version-2222.md +++ /dev/null @@ -1 +0,0 @@ -Update minimum Node version to 22.22.0 diff --git a/packages/create-react-router/.changes/minor.dependency-bumps.md b/packages/create-react-router/.changes/minor.dependency-bumps.md deleted file mode 100644 index f2273adbf6..0000000000 --- a/packages/create-react-router/.changes/minor.dependency-bumps.md +++ /dev/null @@ -1,8 +0,0 @@ -Bump dependencies - -- Bumped `execa` from `5.1.1` to `9.6.1` -- Bumped `log-update` from `^5.0.1` to `^8.0.0` -- Bumped `semver` from `^7.3.7` to `^7.8.1` -- Bumped `sort-package-json` from `^1.55.0` to `^3.6.1` -- Bumped `strip-ansi` from `^6.0.1` to `^7.2.0` -- Bumped `tar-fs` from `^2.1.3` to `^3.1.2` diff --git a/packages/create-react-router/CHANGELOG.md b/packages/create-react-router/CHANGELOG.md index b73392fdff..1efc28735e 100644 --- a/packages/create-react-router/CHANGELOG.md +++ b/packages/create-react-router/CHANGELOG.md @@ -1,5 +1,23 @@ # `create-react-router` +## v8.0.0 + +### Major Changes + +- Switch from `@remix-run/web-fetch` to native `fetch` internally. ([#14929](https://github.com/remix-run/react-router/pull/14929)) + - This removes the underlying `HTTPS_PROXY` support that `node-fetch` and subsequently `@remix-run/web-fetch` supported +- Update minimum Node version to 22.22.0 ([#15143](https://github.com/remix-run/react-router/pull/15143)) + +### Minor Changes + +- Bump dependencies ([#15080](https://github.com/remix-run/react-router/pull/15080)) + - Bumped `execa` from `5.1.1` to `9.6.1` + - Bumped `log-update` from `^5.0.1` to `^8.0.0` + - Bumped `semver` from `^7.3.7` to `^7.8.1` + - Bumped `sort-package-json` from `^1.55.0` to `^3.6.1` + - Bumped `strip-ansi` from `^6.0.1` to `^7.2.0` + - Bumped `tar-fs` from `^2.1.3` to `^3.1.2` + ## v7.18.0 ### Patch Changes diff --git a/packages/create-react-router/package.json b/packages/create-react-router/package.json index 0579481a5e..ee57e71cf2 100644 --- a/packages/create-react-router/package.json +++ b/packages/create-react-router/package.json @@ -1,7 +1,7 @@ { "name": "create-react-router", "type": "module", - "version": "8.0.0-pre.1", + "version": "8.0.0", "description": "Create a new React Router app", "homepage": "https://reactrouter.com", "bugs": { diff --git a/packages/react-router-architect/.changes/major.architect-functions-8.md b/packages/react-router-architect/.changes/major.architect-functions-8.md deleted file mode 100644 index 880347346a..0000000000 --- a/packages/react-router-architect/.changes/major.architect-functions-8.md +++ /dev/null @@ -1 +0,0 @@ -Bump `@architect/functions` to v8 diff --git a/packages/react-router-architect/.changes/major.remove-userequestcontextdomainname-flag.md b/packages/react-router-architect/.changes/major.remove-userequestcontextdomainname-flag.md deleted file mode 100644 index 06fca55371..0000000000 --- a/packages/react-router-architect/.changes/major.remove-userequestcontextdomainname-flag.md +++ /dev/null @@ -1 +0,0 @@ -Remove the `useRequestContextDomainName` option from `createRequestHandler` - this is now the default behavior diff --git a/packages/react-router-architect/.changes/major.update-minimum-node-version-2222.md b/packages/react-router-architect/.changes/major.update-minimum-node-version-2222.md deleted file mode 100644 index e98fc3460f..0000000000 --- a/packages/react-router-architect/.changes/major.update-minimum-node-version-2222.md +++ /dev/null @@ -1 +0,0 @@ -Update minimum Node version to 22.22.0 diff --git a/packages/react-router-architect/.changes/patch.dependency-bumps.md b/packages/react-router-architect/.changes/patch.dependency-bumps.md deleted file mode 100644 index fda0daea4f..0000000000 --- a/packages/react-router-architect/.changes/patch.dependency-bumps.md +++ /dev/null @@ -1,3 +0,0 @@ -Bump dependencies - -- Bumped `@types/aws-lambda` from `^8.10.82` to `^8.10.161` diff --git a/packages/react-router-architect/CHANGELOG.md b/packages/react-router-architect/CHANGELOG.md index 767806f582..c10be2d554 100644 --- a/packages/react-router-architect/CHANGELOG.md +++ b/packages/react-router-architect/CHANGELOG.md @@ -1,5 +1,21 @@ # `@react-router/architect` +## v8.0.0 + +### Major Changes + +- Bump `@architect/functions` to v8 ([#15106](https://github.com/remix-run/react-router/pull/15106)) +- Remove the `useRequestContextDomainName` option from `createRequestHandler` - this is now the default behavior ([#15188](https://github.com/remix-run/react-router/pull/15188)) +- Update minimum Node version to 22.22.0 ([#15143](https://github.com/remix-run/react-router/pull/15143)) + +### Patch Changes + +- Bump dependencies ([#15080](https://github.com/remix-run/react-router/pull/15080)) + - Bumped `@types/aws-lambda` from `^8.10.82` to `^8.10.161` +- Updated dependencies: + - [`react-router@8.0.0`](https://github.com/remix-run/react-router/releases/tag/react-router@8.0.0) + - [`@react-router/node@8.0.0`](https://github.com/remix-run/react-router/releases/tag/@react-router/node@8.0.0) + ## v7.18.0 ### Minor Changes diff --git a/packages/react-router-architect/package.json b/packages/react-router-architect/package.json index bd11654144..d6a3ec1e74 100644 --- a/packages/react-router-architect/package.json +++ b/packages/react-router-architect/package.json @@ -1,7 +1,7 @@ { "name": "@react-router/architect", "type": "module", - "version": "8.0.0-pre.1", + "version": "8.0.0", "description": "Architect server request handler for React Router", "bugs": { "url": "https://github.com/remix-run/react-router/issues" diff --git a/packages/react-router-cloudflare/.changes/major.update-minimum-node-version-2222.md b/packages/react-router-cloudflare/.changes/major.update-minimum-node-version-2222.md deleted file mode 100644 index e98fc3460f..0000000000 --- a/packages/react-router-cloudflare/.changes/major.update-minimum-node-version-2222.md +++ /dev/null @@ -1 +0,0 @@ -Update minimum Node version to 22.22.0 diff --git a/packages/react-router-cloudflare/.changes/minor.bump-types.md b/packages/react-router-cloudflare/.changes/minor.bump-types.md deleted file mode 100644 index 370211d998..0000000000 --- a/packages/react-router-cloudflare/.changes/minor.bump-types.md +++ /dev/null @@ -1 +0,0 @@ -Bump `@cloudflare/workers-types` fromn `^4.20260520.1` to `^4.20260527.1` diff --git a/packages/react-router-cloudflare/CHANGELOG.md b/packages/react-router-cloudflare/CHANGELOG.md index f0628afafb..bdb4f69818 100644 --- a/packages/react-router-cloudflare/CHANGELOG.md +++ b/packages/react-router-cloudflare/CHANGELOG.md @@ -1,5 +1,20 @@ # `@react-router/cloudflare` +## v8.0.0 + +### Major Changes + +- Update minimum Node version to 22.22.0 ([#15143](https://github.com/remix-run/react-router/pull/15143)) + +### Minor Changes + +- Bump `@cloudflare/workers-types` fromn `^4.20260520.1` to `^4.20260527.1` ([#15106](https://github.com/remix-run/react-router/pull/15106)) + +### Patch Changes + +- Updated dependencies: + - [`react-router@8.0.0`](https://github.com/remix-run/react-router/releases/tag/react-router@8.0.0) + ## v7.18.0 ### Patch Changes diff --git a/packages/react-router-cloudflare/package.json b/packages/react-router-cloudflare/package.json index 5811851d63..c7ef69605c 100644 --- a/packages/react-router-cloudflare/package.json +++ b/packages/react-router-cloudflare/package.json @@ -1,7 +1,7 @@ { "name": "@react-router/cloudflare", "type": "module", - "version": "8.0.0-pre.1", + "version": "8.0.0", "description": "Cloudflare platform abstractions for React Router", "bugs": { "url": "https://github.com/remix-run/react-router/issues" diff --git a/packages/react-router-dev/.changes/major.cloudflare-plugin.md b/packages/react-router-dev/.changes/major.cloudflare-plugin.md deleted file mode 100644 index b1511cbe11..0000000000 --- a/packages/react-router-dev/.changes/major.cloudflare-plugin.md +++ /dev/null @@ -1,3 +0,0 @@ -Remove `@react-router/dev/vite/cloudflare` dev proxy export; use `@cloudflare/vite-plugin` instead - -- Drops support for `wrangler@3` as a peer dependency of `@react-router/dev` diff --git a/packages/react-router-dev/.changes/major.drop-trailing-slash-data-request-flag.md b/packages/react-router-dev/.changes/major.drop-trailing-slash-data-request-flag.md deleted file mode 100644 index 020862182a..0000000000 --- a/packages/react-router-dev/.changes/major.drop-trailing-slash-data-request-flag.md +++ /dev/null @@ -1,3 +0,0 @@ -Remove the `future.v8_trailingSlashAwareDataRequests` flag - -- Trailing slash-aware data request URLs are now the default behavior. diff --git a/packages/react-router-dev/.changes/major.remove-passthrough-requests-flag.md b/packages/react-router-dev/.changes/major.remove-passthrough-requests-flag.md deleted file mode 100644 index d6325d4495..0000000000 --- a/packages/react-router-dev/.changes/major.remove-passthrough-requests-flag.md +++ /dev/null @@ -1 +0,0 @@ -Remove `future.v8_passThroughRequests` flag - the raw incoming `request` is now always passed through to `loader`/`action`. diff --git a/packages/react-router-dev/.changes/major.split-route-modules-config.md b/packages/react-router-dev/.changes/major.split-route-modules-config.md deleted file mode 100644 index 7d84b93973..0000000000 --- a/packages/react-router-dev/.changes/major.split-route-modules-config.md +++ /dev/null @@ -1,4 +0,0 @@ -Move `future.v8_splitRouteModules` to a top-level `splitRouteModules` config option and change the default behavior to `true` - -- Set `splitRouteModules: false` to keep route modules in a single chunk -- Set `splitRouteModules: "enforce"` to require all routes to be splittable diff --git a/packages/react-router-dev/.changes/major.update-minimum-node-version-2212.md b/packages/react-router-dev/.changes/major.update-minimum-node-version-2212.md deleted file mode 100644 index e98fc3460f..0000000000 --- a/packages/react-router-dev/.changes/major.update-minimum-node-version-2212.md +++ /dev/null @@ -1 +0,0 @@ -Update minimum Node version to 22.22.0 diff --git a/packages/react-router-dev/.changes/major.vite-7.md b/packages/react-router-dev/.changes/major.vite-7.md deleted file mode 100644 index 5cf6e54ea6..0000000000 --- a/packages/react-router-dev/.changes/major.vite-7.md +++ /dev/null @@ -1 +0,0 @@ -Require Vite 7+ and make the Vite Environment API build path mandatory diff --git a/packages/react-router-dev/.changes/major.vite-environment-api.md b/packages/react-router-dev/.changes/major.vite-environment-api.md deleted file mode 100644 index 5d974384d8..0000000000 --- a/packages/react-router-dev/.changes/major.vite-environment-api.md +++ /dev/null @@ -1 +0,0 @@ -Removed the `future.v8_viteEnvironmentApi` flag because the Vite Environment API is always enabled diff --git a/packages/react-router-dev/.changes/major.vite-prerendering.md b/packages/react-router-dev/.changes/major.vite-prerendering.md deleted file mode 100644 index 4394ed1dd6..0000000000 --- a/packages/react-router-dev/.changes/major.vite-prerendering.md +++ /dev/null @@ -1 +0,0 @@ -Removed the `future.unstable_previewServerPrerendering` flag and make prerendering with the Vite Environment API the default. diff --git a/packages/react-router-dev/.changes/minor.dependency-bumps.md b/packages/react-router-dev/.changes/minor.dependency-bumps.md deleted file mode 100644 index 5bc4900bcc..0000000000 --- a/packages/react-router-dev/.changes/minor.dependency-bumps.md +++ /dev/null @@ -1,18 +0,0 @@ -Bump dependencies - -- Bumped `@babel/core` from `^7.27.7` to `^7.29.7` -- Bumped `@babel/generator` from `^7.27.5` to `^7.29.7` -- Bumped `@babel/parser` from `^7.27.7` to `^7.29.7` -- Bumped `@babel/plugin-syntax-jsx` from `^7.27.1` to `^7.29.7` -- Bumped `@babel/preset-typescript` from `^7.27.1` to `^7.29.7` -- Bumped `@babel/traverse` from `^7.27.7` to `^7.29.7` -- Bumped `@babel/types` from `^7.27.7` to `^7.29.7` -- Bumped `dedent` from `^1.5.3` to `^1.7.2` -- Bumped `jsesc` from `3.0.2` to `3.1.0` -- Bumped `lodash` from `^4.17.21` to `^4.18.1` -- Bumped `prettier` from `^3.6.2` to `^3.8.3` -- Bumped `@remix-run/node-fetch-server` from `^0.13.0` to `^0.13.3` -- Bumped `react-refresh` from `^0.14.0` to `^0.18.0` -- Bumped `semver` from `^7.3.7` to `^7.8.1` -- Bumped `tinyglobby` from `^0.2.14` to `^0.2.16` -- Bumped `valibot` from `^1.2.0` to `^1.4.1` diff --git a/packages/react-router-dev/.changes/minor.replace-cookie-libs.md b/packages/react-router-dev/.changes/minor.replace-cookie-libs.md deleted file mode 100644 index b4b8437afa..0000000000 --- a/packages/react-router-dev/.changes/minor.replace-cookie-libs.md +++ /dev/null @@ -1 +0,0 @@ -Replace `cookie` and `set-cookie-parser` with `cookie-es` diff --git a/packages/react-router-dev/.changes/minor.vite-node-removal.md b/packages/react-router-dev/.changes/minor.vite-node-removal.md deleted file mode 100644 index 94204cfe70..0000000000 --- a/packages/react-router-dev/.changes/minor.vite-node-removal.md +++ /dev/null @@ -1 +0,0 @@ -Removed the `vite-node` dependency in favor of Vite's native module runner APIs diff --git a/packages/react-router-dev/.changes/patch.dependency-bumps.md b/packages/react-router-dev/.changes/patch.dependency-bumps.md deleted file mode 100644 index a35920ab7f..0000000000 --- a/packages/react-router-dev/.changes/patch.dependency-bumps.md +++ /dev/null @@ -1,21 +0,0 @@ -Bump dependencies - -- Bumped `@babel/core` from `^7.29.0` to `^7.29.7` -- Bumped `@babel/generator` from `^7.29.1` to `^7.29.7` -- Bumped `@babel/parser` from `^7.29.3` to `^7.29.7` -- Bumped `@babel/plugin-syntax-jsx` from `^7.28.6` to `^7.29.7` -- Bumped `@babel/preset-typescript` from `^7.28.5` to `^7.29.7` -- Bumped `@babel/traverse` from `^7.29.0` to `^7.29.7` -- Bumped `@babel/types` from `^7.29.0` to `^7.29.7` -- Bumped `babel-dead-code-elimination` from `^1.0.6` to `^1.0.12` -- Bumped `chokidar` from `^4.0.0` to `^5.0.0` -- Bumped `es-module-lexer` from `^1.3.1` to `^2.1.0` -- Bumped `exit-hook` from `2.2.1` to `5.1.0` -- Bumped `isbot` from `^5.1.11` to `^5.1.40` -- Bumped `p-map` from `^7.0.3` to `^7.0.4` -- Bumped `pathe` from `^1.1.2` to `^2.0.3` -- Bumped `pkg-types` from `^2.3.0` to `^2.3.1` -- Bumped `react-refresh` from `^0.14.0` to `^0.18.0` -- Bumped `semver` from `^7.8.0` to `^7.8.1` -- Bumped `tinyglobby` from `^0.2.14` to `^0.2.16` -- Bumped `valibot` from `^1.4.0` to `^1.4.1` diff --git a/packages/react-router-dev/.changes/patch.prerender-windows-libuv-assertion.md b/packages/react-router-dev/.changes/patch.prerender-windows-libuv-assertion.md deleted file mode 100644 index a175180b44..0000000000 --- a/packages/react-router-dev/.changes/patch.prerender-windows-libuv-assertion.md +++ /dev/null @@ -1 +0,0 @@ -Fix Windows libuv assertion (`!(handle->flags & UV_HANDLE_CLOSING)` in `src/win/async.c`) during prerendering by using `node:http` instead of `fetch` for internal prerender requests against the Vite preview server diff --git a/packages/react-router-dev/CHANGELOG.md b/packages/react-router-dev/CHANGELOG.md index d9d46dd4c5..00f065d2fb 100644 --- a/packages/react-router-dev/CHANGELOG.md +++ b/packages/react-router-dev/CHANGELOG.md @@ -1,5 +1,72 @@ # `@react-router/dev` +## v8.0.0 + +### Major Changes + +- Remove `@react-router/dev/vite/cloudflare` dev proxy export; use `@cloudflare/vite-plugin` instead ([#15077](https://github.com/remix-run/react-router/pull/15077)) + - Drops support for `wrangler@3` as a peer dependency of `@react-router/dev` +- Remove the `future.v8_trailingSlashAwareDataRequests` flag ([#15100](https://github.com/remix-run/react-router/pull/15100)) + - Trailing slash-aware data request URLs are now the default behavior. +- Remove `future.v8_passThroughRequests` flag - the raw incoming `request` is now always passed through to `loader`/`action`. ([#15079](https://github.com/remix-run/react-router/pull/15079)) +- Move `future.v8_splitRouteModules` to a top-level `splitRouteModules` config option and change the default behavior to `true` ([#15086](https://github.com/remix-run/react-router/pull/15086)) + - Set `splitRouteModules: false` to keep route modules in a single chunk + - Set `splitRouteModules: "enforce"` to require all routes to be splittable +- Update minimum Node version to 22.22.0 ([#14928](https://github.com/remix-run/react-router/pull/14928)) +- Require Vite 7+ and make the Vite Environment API build path mandatory ([#15077](https://github.com/remix-run/react-router/pull/15077)) +- Removed the `future.v8_viteEnvironmentApi` flag because the Vite Environment API is always enabled ([#15077](https://github.com/remix-run/react-router/pull/15077)) +- Removed the `future.unstable_previewServerPrerendering` flag and make prerendering with the Vite Environment API the default. ([#15077](https://github.com/remix-run/react-router/pull/15077)) + +### Minor Changes + +- Bump dependencies ([#15080](https://github.com/remix-run/react-router/pull/15080)) + - Bumped `@babel/core` from `^7.27.7` to `^7.29.7` + - Bumped `@babel/generator` from `^7.27.5` to `^7.29.7` + - Bumped `@babel/parser` from `^7.27.7` to `^7.29.7` + - Bumped `@babel/plugin-syntax-jsx` from `^7.27.1` to `^7.29.7` + - Bumped `@babel/preset-typescript` from `^7.27.1` to `^7.29.7` + - Bumped `@babel/traverse` from `^7.27.7` to `^7.29.7` + - Bumped `@babel/types` from `^7.27.7` to `^7.29.7` + - Bumped `dedent` from `^1.5.3` to `^1.7.2` + - Bumped `jsesc` from `3.0.2` to `3.1.0` + - Bumped `lodash` from `^4.17.21` to `^4.18.1` + - Bumped `prettier` from `^3.6.2` to `^3.8.3` + - Bumped `@remix-run/node-fetch-server` from `^0.13.0` to `^0.13.3` + - Bumped `react-refresh` from `^0.14.0` to `^0.18.0` + - Bumped `semver` from `^7.3.7` to `^7.8.1` + - Bumped `tinyglobby` from `^0.2.14` to `^0.2.16` + - Bumped `valibot` from `^1.2.0` to `^1.4.1` +- Replace `cookie` and `set-cookie-parser` with `cookie-es` ([#15109](https://github.com/remix-run/react-router/pull/15109)) +- Removed the `vite-node` dependency in favor of Vite's native module runner APIs ([#15104](https://github.com/remix-run/react-router/pull/15104)) + +### Patch Changes + +- Bump dependencies ([#15080](https://github.com/remix-run/react-router/pull/15080)) + - Bumped `@babel/core` from `^7.29.0` to `^7.29.7` + - Bumped `@babel/generator` from `^7.29.1` to `^7.29.7` + - Bumped `@babel/parser` from `^7.29.3` to `^7.29.7` + - Bumped `@babel/plugin-syntax-jsx` from `^7.28.6` to `^7.29.7` + - Bumped `@babel/preset-typescript` from `^7.28.5` to `^7.29.7` + - Bumped `@babel/traverse` from `^7.29.0` to `^7.29.7` + - Bumped `@babel/types` from `^7.29.0` to `^7.29.7` + - Bumped `babel-dead-code-elimination` from `^1.0.6` to `^1.0.12` + - Bumped `chokidar` from `^4.0.0` to `^5.0.0` + - Bumped `es-module-lexer` from `^1.3.1` to `^2.1.0` + - Bumped `exit-hook` from `2.2.1` to `5.1.0` + - Bumped `isbot` from `^5.1.11` to `^5.1.40` + - Bumped `p-map` from `^7.0.3` to `^7.0.4` + - Bumped `pathe` from `^1.1.2` to `^2.0.3` + - Bumped `pkg-types` from `^2.3.0` to `^2.3.1` + - Bumped `react-refresh` from `^0.14.0` to `^0.18.0` + - Bumped `semver` from `^7.8.0` to `^7.8.1` + - Bumped `tinyglobby` from `^0.2.14` to `^0.2.16` + - Bumped `valibot` from `^1.4.0` to `^1.4.1` +- Fix Windows libuv assertion (`!(handle->flags & UV_HANDLE_CLOSING)` in `src/win/async.c`) during prerendering by using `node:http` instead of `fetch` for internal prerender requests against the Vite preview server ([#15077](https://github.com/remix-run/react-router/pull/15077)) +- Updated dependencies: + - [`react-router@8.0.0`](https://github.com/remix-run/react-router/releases/tag/react-router@8.0.0) + - [`@react-router/node@8.0.0`](https://github.com/remix-run/react-router/releases/tag/@react-router/node@8.0.0) + - [`@react-router/serve@8.0.0`](https://github.com/remix-run/react-router/releases/tag/@react-router/serve@8.0.0) + ## v7.18.0 ### Patch Changes diff --git a/packages/react-router-dev/package.json b/packages/react-router-dev/package.json index 3c462bd72a..2101cc2047 100644 --- a/packages/react-router-dev/package.json +++ b/packages/react-router-dev/package.json @@ -1,7 +1,7 @@ { "name": "@react-router/dev", "type": "module", - "version": "8.0.0-pre.1", + "version": "8.0.0", "description": "Dev tools and CLI for React Router", "homepage": "https://reactrouter.com", "bugs": { diff --git a/packages/react-router-express/.changes/major.dependency-bumps.md b/packages/react-router-express/.changes/major.dependency-bumps.md deleted file mode 100644 index a97dc8c8e2..0000000000 --- a/packages/react-router-express/.changes/major.dependency-bumps.md +++ /dev/null @@ -1,5 +0,0 @@ -Bump dependencies - -- Bumped `express` from `^4.19.2` to `^4.22.2` -- Bumped the `express` peer dependency from `^4.17.1 || ^5` to `^4.22.2 || ^5` -- Bumped `@types/express` from `^4.17.9` to `^4.17.25` diff --git a/packages/react-router-express/.changes/major.update-minimum-node-version-2212.md b/packages/react-router-express/.changes/major.update-minimum-node-version-2212.md deleted file mode 100644 index e98fc3460f..0000000000 --- a/packages/react-router-express/.changes/major.update-minimum-node-version-2212.md +++ /dev/null @@ -1 +0,0 @@ -Update minimum Node version to 22.22.0 diff --git a/packages/react-router-express/CHANGELOG.md b/packages/react-router-express/CHANGELOG.md index 0bf809897e..9cb8b5c815 100644 --- a/packages/react-router-express/CHANGELOG.md +++ b/packages/react-router-express/CHANGELOG.md @@ -1,5 +1,21 @@ # `@react-router/express` +## v8.0.0 + +### Major Changes + +- Bump dependencies ([#15106](https://github.com/remix-run/react-router/pull/15106)) + - Bumped `express` from `^4.19.2` to `^4.22.2` + - Bumped the `express` peer dependency from `^4.17.1 || ^5` to `^4.22.2 || ^5` + - Bumped `@types/express` from `^4.17.9` to `^4.17.25` +- Update minimum Node version to 22.22.0 ([#14928](https://github.com/remix-run/react-router/pull/14928)) + +### Patch Changes + +- Updated dependencies: + - [`react-router@8.0.0`](https://github.com/remix-run/react-router/releases/tag/react-router@8.0.0) + - [`@react-router/node@8.0.0`](https://github.com/remix-run/react-router/releases/tag/@react-router/node@8.0.0) + ## v7.18.0 ### Patch Changes diff --git a/packages/react-router-express/package.json b/packages/react-router-express/package.json index 1c7f504eef..3b1e71e4b0 100644 --- a/packages/react-router-express/package.json +++ b/packages/react-router-express/package.json @@ -1,7 +1,7 @@ { "name": "@react-router/express", "type": "module", - "version": "8.0.0-pre.1", + "version": "8.0.0", "description": "Express server request handler for React Router", "bugs": { "url": "https://github.com/remix-run/react-router/issues" diff --git a/packages/react-router-fs-routes/.changes/major.update-minimum-node-version-2222.md b/packages/react-router-fs-routes/.changes/major.update-minimum-node-version-2222.md deleted file mode 100644 index e98fc3460f..0000000000 --- a/packages/react-router-fs-routes/.changes/major.update-minimum-node-version-2222.md +++ /dev/null @@ -1 +0,0 @@ -Update minimum Node version to 22.22.0 diff --git a/packages/react-router-fs-routes/.changes/patch.dependency-bumps.md b/packages/react-router-fs-routes/.changes/patch.dependency-bumps.md deleted file mode 100644 index d74fbe3d54..0000000000 --- a/packages/react-router-fs-routes/.changes/patch.dependency-bumps.md +++ /dev/null @@ -1,3 +0,0 @@ -Bump dependencies - -- Bumped `minimatch` from `^9.0.0` to `^10.2.5` diff --git a/packages/react-router-fs-routes/CHANGELOG.md b/packages/react-router-fs-routes/CHANGELOG.md index 5a72bcf580..5cdb1adaea 100644 --- a/packages/react-router-fs-routes/CHANGELOG.md +++ b/packages/react-router-fs-routes/CHANGELOG.md @@ -1,5 +1,18 @@ # `@react-router/fs-routes` +## v8.0.0 + +### Major Changes + +- Update minimum Node version to 22.22.0 ([#15143](https://github.com/remix-run/react-router/pull/15143)) + +### Patch Changes + +- Bump dependencies ([#15091](https://github.com/remix-run/react-router/pull/15091)) + - Bumped `minimatch` from `^9.0.0` to `^10.2.5` +- Updated dependencies: + - [`@react-router/dev@8.0.0`](https://github.com/remix-run/react-router/releases/tag/@react-router/dev@8.0.0) + ## v7.18.0 ### Patch Changes diff --git a/packages/react-router-fs-routes/package.json b/packages/react-router-fs-routes/package.json index eeaa5f50f4..7aa7da7126 100644 --- a/packages/react-router-fs-routes/package.json +++ b/packages/react-router-fs-routes/package.json @@ -1,7 +1,7 @@ { "name": "@react-router/fs-routes", "type": "module", - "version": "8.0.0-pre.1", + "version": "8.0.0", "description": "File system routing conventions for React Router, for use within routes.ts", "bugs": { "url": "https://github.com/remix-run/react-router/issues" diff --git a/packages/react-router-node/.changes/major.switch-mjacksonnodefetchserver-remixrunnodefetchserver-can-directly-use.md b/packages/react-router-node/.changes/major.switch-mjacksonnodefetchserver-remixrunnodefetchserver-can-directly-use.md deleted file mode 100644 index a8e09c7a0c..0000000000 --- a/packages/react-router-node/.changes/major.switch-mjacksonnodefetchserver-remixrunnodefetchserver-can-directly-use.md +++ /dev/null @@ -1 +0,0 @@ -Switch from `@mjackson/node-fetch-server` to `@remix-run/node-fetch-server` now that we can directly use ESM-only packages diff --git a/packages/react-router-node/.changes/major.update-minimum-node-version-2212.md b/packages/react-router-node/.changes/major.update-minimum-node-version-2212.md deleted file mode 100644 index e98fc3460f..0000000000 --- a/packages/react-router-node/.changes/major.update-minimum-node-version-2212.md +++ /dev/null @@ -1 +0,0 @@ -Update minimum Node version to 22.22.0 diff --git a/packages/react-router-node/.changes/patch.dependency-bumps.md b/packages/react-router-node/.changes/patch.dependency-bumps.md deleted file mode 100644 index 6cc743492c..0000000000 --- a/packages/react-router-node/.changes/patch.dependency-bumps.md +++ /dev/null @@ -1,3 +0,0 @@ -Bump dependencies - -- Bumped `@remix-run/node-fetch-server` from `^0.13.0` to `^0.13.3` diff --git a/packages/react-router-node/CHANGELOG.md b/packages/react-router-node/CHANGELOG.md index c0015b6aca..0a19a28531 100644 --- a/packages/react-router-node/CHANGELOG.md +++ b/packages/react-router-node/CHANGELOG.md @@ -1,5 +1,19 @@ # `@react-router/node` +## v8.0.0 + +### Major Changes + +- Switch from `@mjackson/node-fetch-server` to `@remix-run/node-fetch-server` now that we can directly use ESM-only packages ([#14930](https://github.com/remix-run/react-router/pull/14930)) +- Update minimum Node version to 22.22.0 ([#14928](https://github.com/remix-run/react-router/pull/14928)) + +### Patch Changes + +- Bump dependencies ([#15106](https://github.com/remix-run/react-router/pull/15106)) + - Bumped `@remix-run/node-fetch-server` from `^0.13.0` to `^0.13.3` +- Updated dependencies: + - [`react-router@8.0.0`](https://github.com/remix-run/react-router/releases/tag/react-router@8.0.0) + ## v7.18.0 ### Patch Changes diff --git a/packages/react-router-node/package.json b/packages/react-router-node/package.json index f542026840..c719cf42bc 100644 --- a/packages/react-router-node/package.json +++ b/packages/react-router-node/package.json @@ -1,7 +1,7 @@ { "name": "@react-router/node", "type": "module", - "version": "8.0.0-pre.1", + "version": "8.0.0", "description": "Node.js platform abstractions for React Router", "bugs": { "url": "https://github.com/remix-run/react-router/issues" diff --git a/packages/react-router-remix-routes-option-adapter/.changes/major.update-minimum-node-version-2222.md b/packages/react-router-remix-routes-option-adapter/.changes/major.update-minimum-node-version-2222.md deleted file mode 100644 index e98fc3460f..0000000000 --- a/packages/react-router-remix-routes-option-adapter/.changes/major.update-minimum-node-version-2222.md +++ /dev/null @@ -1 +0,0 @@ -Update minimum Node version to 22.22.0 diff --git a/packages/react-router-remix-routes-option-adapter/CHANGELOG.md b/packages/react-router-remix-routes-option-adapter/CHANGELOG.md index e39c7ca7d3..2c94179182 100644 --- a/packages/react-router-remix-routes-option-adapter/CHANGELOG.md +++ b/packages/react-router-remix-routes-option-adapter/CHANGELOG.md @@ -1,5 +1,16 @@ # `@react-router/remix-config-routes-adapter` +## v8.0.0 + +### Major Changes + +- Update minimum Node version to 22.22.0 ([#15143](https://github.com/remix-run/react-router/pull/15143)) + +### Patch Changes + +- Updated dependencies: + - [`@react-router/dev@8.0.0`](https://github.com/remix-run/react-router/releases/tag/@react-router/dev@8.0.0) + ## v7.18.0 ### Patch Changes diff --git a/packages/react-router-remix-routes-option-adapter/package.json b/packages/react-router-remix-routes-option-adapter/package.json index 064a0dbddc..021c14780c 100644 --- a/packages/react-router-remix-routes-option-adapter/package.json +++ b/packages/react-router-remix-routes-option-adapter/package.json @@ -1,7 +1,7 @@ { "name": "@react-router/remix-routes-option-adapter", "type": "module", - "version": "8.0.0-pre.1", + "version": "8.0.0", "description": "Adapter for Remix's \"routes\" config option, for use within routes.ts", "bugs": { "url": "https://github.com/remix-run/react-router/issues" diff --git a/packages/react-router-serve/.changes/major.switch-mjacksonnodefetchserver-remixrunnodefetchserver-can-directly-use.md b/packages/react-router-serve/.changes/major.switch-mjacksonnodefetchserver-remixrunnodefetchserver-can-directly-use.md deleted file mode 100644 index a8e09c7a0c..0000000000 --- a/packages/react-router-serve/.changes/major.switch-mjacksonnodefetchserver-remixrunnodefetchserver-can-directly-use.md +++ /dev/null @@ -1 +0,0 @@ -Switch from `@mjackson/node-fetch-server` to `@remix-run/node-fetch-server` now that we can directly use ESM-only packages diff --git a/packages/react-router-serve/.changes/major.update-minimum-node-version-2212.md b/packages/react-router-serve/.changes/major.update-minimum-node-version-2212.md deleted file mode 100644 index e98fc3460f..0000000000 --- a/packages/react-router-serve/.changes/major.update-minimum-node-version-2212.md +++ /dev/null @@ -1 +0,0 @@ -Update minimum Node version to 22.22.0 diff --git a/packages/react-router-serve/.changes/minor.bump-express b/packages/react-router-serve/.changes/minor.bump-express deleted file mode 100644 index 59348fb6d8..0000000000 --- a/packages/react-router-serve/.changes/minor.bump-express +++ /dev/null @@ -1 +0,0 @@ -Upgrade `express` from `4.21.2` to `5.2.1` diff --git a/packages/react-router-serve/.changes/patch.dependency-bumps.md b/packages/react-router-serve/.changes/patch.dependency-bumps.md deleted file mode 100644 index e849ca7b74..0000000000 --- a/packages/react-router-serve/.changes/patch.dependency-bumps.md +++ /dev/null @@ -1,4 +0,0 @@ -Bump dependencies - -- Bumped `@remix-run/node-fetch-server` from `^0.13.0` to `^0.13.3` -- Bumped `get-port` from `5.1.1` to `7.2.0` diff --git a/packages/react-router-serve/CHANGELOG.md b/packages/react-router-serve/CHANGELOG.md index 65b1bd9849..c2e38da779 100644 --- a/packages/react-router-serve/CHANGELOG.md +++ b/packages/react-router-serve/CHANGELOG.md @@ -1,5 +1,26 @@ # `@react-router/serve` +## v8.0.0 + +### Major Changes + +- Switch from `@mjackson/node-fetch-server` to `@remix-run/node-fetch-server` now that we can directly use ESM-only packages ([#14930](https://github.com/remix-run/react-router/pull/14930)) +- Update minimum Node version to 22.22.0 ([#14928](https://github.com/remix-run/react-router/pull/14928)) + +### Minor Changes + +- Bump `express` from `4.21.2` to `5.2.1` + +### Patch Changes + +- Bump dependencies ([#15091](https://github.com/remix-run/react-router/pull/15091)) + - Bumped `@remix-run/node-fetch-server` from `^0.13.0` to `^0.13.3` + - Bumped `get-port` from `5.1.1` to `7.2.0` +- Updated dependencies: + - [`react-router@8.0.0`](https://github.com/remix-run/react-router/releases/tag/react-router@8.0.0) + - [`@react-router/express@8.0.0`](https://github.com/remix-run/react-router/releases/tag/@react-router/express@8.0.0) + - [`@react-router/node@8.0.0`](https://github.com/remix-run/react-router/releases/tag/@react-router/node@8.0.0) + ## v7.18.0 ### Patch Changes diff --git a/packages/react-router-serve/package.json b/packages/react-router-serve/package.json index 6909862144..880c23f8c8 100644 --- a/packages/react-router-serve/package.json +++ b/packages/react-router-serve/package.json @@ -1,7 +1,7 @@ { "name": "@react-router/serve", "type": "module", - "version": "8.0.0-pre.1", + "version": "8.0.0", "description": "Production application server for React Router", "bugs": { "url": "https://github.com/remix-run/react-router/issues" diff --git a/packages/react-router/.changes/major.drop-trailing-slash-data-request-flag.md b/packages/react-router/.changes/major.drop-trailing-slash-data-request-flag.md deleted file mode 100644 index 020862182a..0000000000 --- a/packages/react-router/.changes/major.drop-trailing-slash-data-request-flag.md +++ /dev/null @@ -1,3 +0,0 @@ -Remove the `future.v8_trailingSlashAwareDataRequests` flag - -- Trailing slash-aware data request URLs are now the default behavior. diff --git a/packages/react-router/.changes/major.es2022.md b/packages/react-router/.changes/major.es2022.md deleted file mode 100644 index d28a98831c..0000000000 --- a/packages/react-router/.changes/major.es2022.md +++ /dev/null @@ -1 +0,0 @@ -Update `tsconfig.json` `target`/`lib` from `ES2020 -> ES2022` diff --git a/packages/react-router/.changes/major.esm-only-packages.md b/packages/react-router/.changes/major.esm-only-packages.md deleted file mode 100644 index 6cda7da06b..0000000000 --- a/packages/react-router/.changes/major.esm-only-packages.md +++ /dev/null @@ -1 +0,0 @@ -Switch the published packages in `packages/` to ESM-only. ([#14895](https://github.com/remix-run/react-router/pull/14895)) diff --git a/packages/react-router/.changes/major.remove-deprecated-data-parameter-favor-loaderdata.md b/packages/react-router/.changes/major.remove-deprecated-data-parameter-favor-loaderdata.md deleted file mode 100644 index a518db696e..0000000000 --- a/packages/react-router/.changes/major.remove-deprecated-data-parameter-favor-loaderdata.md +++ /dev/null @@ -1,3 +0,0 @@ -Remove deprecated `data` parameter in favor of `loaderData` for `meta` APIs (to align with `Route.ComponentProps`) - -- `Route.MetaArgs`, `Route.MetaMatch`, `MetaArgs`, `MetaMatch`, `Route.ComponentProps.matches`, `UIMatch` diff --git a/packages/react-router/.changes/major.remove-passthrough-requests-flag.md b/packages/react-router/.changes/major.remove-passthrough-requests-flag.md deleted file mode 100644 index 9d654d8a55..0000000000 --- a/packages/react-router/.changes/major.remove-passthrough-requests-flag.md +++ /dev/null @@ -1 +0,0 @@ -Remove `future.v8_passThroughRequests` flag - the raw incoming `request` is now always passed through to `loader`/`action`. Use `url` for the normalized URL without React Router-specific implementation details (`.data` suffixes, `index`/`_routes` search params). diff --git a/packages/react-router/.changes/major.remove-route-object-hasErrorBoundary.md b/packages/react-router/.changes/major.remove-route-object-hasErrorBoundary.md deleted file mode 100644 index faeb3555ed..0000000000 --- a/packages/react-router/.changes/major.remove-route-object-hasErrorBoundary.md +++ /dev/null @@ -1,5 +0,0 @@ -Remove internal `hasErrorBoundary` field added to `router.routes` when using a data router - -- This should not impact user-facing code since this was an internal prop and was computed based on the presence of `ErrorBoundary` or `errorElement` on your route -- `hasErrorBoundary` is no longer accepted on `RouteObject` (`IndexRouteObject`/`NonIndexRouteObject`), `DataRouteObject`, `` JSX props, or as a key in `lazy` route definitions. -- The `MapRoutePropertiesFunction` signature no longer requires returning `hasErrorBoundary`; the router infers it directly. diff --git a/packages/react-router/.changes/major.remove-rrdom.md b/packages/react-router/.changes/major.remove-rrdom.md deleted file mode 100644 index 3f9768162e..0000000000 --- a/packages/react-router/.changes/major.remove-rrdom.md +++ /dev/null @@ -1,7 +0,0 @@ -Remove `react-router-dom` package - -- In v7 everything DOM-specific was collapsed into `react-router/dom` - - `react-router-dom` was kept around as a convenience so existing v6 app imports would still work -- For v8, you will need to swap `react-router-dom` imports: - - `RouterProvider`/`HydratedRouter` should be imported from `react-router/dom` - - Everything else should be imported from `react-router` diff --git a/packages/react-router/.changes/major.remove-v8-middleware-flag.md b/packages/react-router/.changes/major.remove-v8-middleware-flag.md deleted file mode 100644 index 339a6eb871..0000000000 --- a/packages/react-router/.changes/major.remove-v8-middleware-flag.md +++ /dev/null @@ -1,7 +0,0 @@ -Remove `future.v8_middleware` flag — middleware is always enabled in v8 - -- The `future.v8_middleware` flag has been removed; middleware is now always enabled -- The `context` parameter passed to `loader`, `action`, and `middleware` functions is always a `RouterContextProvider` instance -- `getLoadContext` functions in custom servers must return a `RouterContextProvider` — returning a plain object is no longer supported -- The `MiddlewareEnabled` type (previously exported as `UNSAFE_MiddlewareEnabled`) has been removed since the conditional it gated is now unconditional -- The `Future` module augmentation pattern (`interface Future { v8_middleware: true }`) is no longer needed to type `context` in Data Mode diff --git a/packages/react-router/.changes/major.update-minimum-node-version-2212.md b/packages/react-router/.changes/major.update-minimum-node-version-2212.md deleted file mode 100644 index e98fc3460f..0000000000 --- a/packages/react-router/.changes/major.update-minimum-node-version-2212.md +++ /dev/null @@ -1 +0,0 @@ -Update minimum Node version to 22.22.0 diff --git a/packages/react-router/.changes/major.update-minimum-react-version-1926.md b/packages/react-router/.changes/major.update-minimum-react-version-1926.md deleted file mode 100644 index 823116a30d..0000000000 --- a/packages/react-router/.changes/major.update-minimum-react-version-1926.md +++ /dev/null @@ -1 +0,0 @@ -Update minimum React version to 19.2.7 diff --git a/packages/react-router/.changes/minor.dependency-bumps.md b/packages/react-router/.changes/minor.dependency-bumps.md deleted file mode 100644 index 213a4a1370..0000000000 --- a/packages/react-router/.changes/minor.dependency-bumps.md +++ /dev/null @@ -1,4 +0,0 @@ -Bump dependencies - -- Bumped `cookie` from `^1.0.1` to `^1.1.1` -- Bumped `set-cookie-parser` from `^2.6.0` to `^3.1.0` diff --git a/packages/react-router/.changes/patch.client-middleware-lazy-error-boundary.md b/packages/react-router/.changes/patch.client-middleware-lazy-error-boundary.md deleted file mode 100644 index 60c25d6f8e..0000000000 --- a/packages/react-router/.changes/patch.client-middleware-lazy-error-boundary.md +++ /dev/null @@ -1 +0,0 @@ -Ensure client middleware errors load lazy route error boundaries before bubbling diff --git a/packages/react-router/.changes/patch.fix-form-onsubmit-type.md b/packages/react-router/.changes/patch.fix-form-onsubmit-type.md deleted file mode 100644 index 944906c10e..0000000000 --- a/packages/react-router/.changes/patch.fix-form-onsubmit-type.md +++ /dev/null @@ -1 +0,0 @@ -Remove explicit `onSubmit` type override from `SharedFormProps` to fix deprecation warning with `@types/react@19.x` ([#14932](https://github.com/remix-run/react-router/pull/14932)) diff --git a/packages/react-router/.changes/patch.preserve-module-build-output.md b/packages/react-router/.changes/patch.preserve-module-build-output.md deleted file mode 100644 index 8fe71be459..0000000000 --- a/packages/react-router/.changes/patch.preserve-module-build-output.md +++ /dev/null @@ -1,3 +0,0 @@ -Update 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. diff --git a/packages/react-router/.changes/patch.tsdown-builds.md b/packages/react-router/.changes/patch.tsdown-builds.md deleted file mode 100644 index 7b5c6f271d..0000000000 --- a/packages/react-router/.changes/patch.tsdown-builds.md +++ /dev/null @@ -1 +0,0 @@ -Migrate package builds from `tsup` to `tsdown`. Published package entry points and public APIs are unchanged. diff --git a/packages/react-router/.changes/patch.typescript-6.md b/packages/react-router/.changes/patch.typescript-6.md deleted file mode 100644 index 9242953570..0000000000 --- a/packages/react-router/.changes/patch.typescript-6.md +++ /dev/null @@ -1 +0,0 @@ -Upgrade React Router's TypeScript tooling to TypeScript 6. Runtime behavior and public APIs are unchanged. diff --git a/packages/react-router/CHANGELOG.md b/packages/react-router/CHANGELOG.md index 917909fb6f..4e126ea536 100644 --- a/packages/react-router/CHANGELOG.md +++ b/packages/react-router/CHANGELOG.md @@ -1,5 +1,50 @@ # `react-router` +## v8.0.0 + +### Major Changes + +- Remove the `future.v8_trailingSlashAwareDataRequests` flag ([#15100](https://github.com/remix-run/react-router/pull/15100)) + - Trailing slash-aware data request URLs are now the default behavior. +- Update `tsconfig.json` `target`/`lib` from `ES2020 -> ES2022` ([591853e](https://github.com/remix-run/react-router/commit/591853e)) +- Switch the published packages in `packages/` to ESM-only. ([#14895](https://github.com/remix-run/react-router/pull/14895)) ([59ebcf1](https://github.com/remix-run/react-router/commit/59ebcf1)) +- Remove deprecated `data` parameter in favor of `loaderData` for `meta` APIs (to align with `Route.ComponentProps`) ([#14931](https://github.com/remix-run/react-router/pull/14931)) + - `Route.MetaArgs`, `Route.MetaMatch`, `MetaArgs`, `MetaMatch`, `Route.ComponentProps.matches`, `UIMatch` +- Remove `future.v8_passThroughRequests` flag - the raw incoming `request` is now always passed through to `loader`/`action`. Use `url` for the normalized URL without React Router-specific implementation details (`.data` suffixes, `index`/`_routes` search params). ([#15079](https://github.com/remix-run/react-router/pull/15079)) +- Remove internal `hasErrorBoundary` field added to `router.routes` when using a data router ([#15074](https://github.com/remix-run/react-router/pull/15074)) + - This should not impact user-facing code since this was an internal prop and was computed based on the presence of `ErrorBoundary` or `errorElement` on your route + - `hasErrorBoundary` is no longer accepted on `RouteObject` (`IndexRouteObject`/`NonIndexRouteObject`), `DataRouteObject`, `` JSX props, or as a key in `lazy` route definitions. + - The `MapRoutePropertiesFunction` signature no longer requires returning `hasErrorBoundary`; the router infers it directly. +- Remove `react-router-dom` package ([#15076](https://github.com/remix-run/react-router/pull/15076)) + - In v7 everything DOM-specific was collapsed into `react-router/dom` + - `react-router-dom` was kept around as a convenience so existing v6 app imports would still work + - For v8, you will need to swap `react-router-dom` imports: + - `RouterProvider`/`HydratedRouter` should be imported from `react-router/dom` + - Everything else should be imported from `react-router` +- Remove `future.v8_middleware` flag — middleware is always enabled in v8 ([#15078](https://github.com/remix-run/react-router/pull/15078)) + - The `future.v8_middleware` flag has been removed; middleware is now always enabled + - The `context` parameter passed to `loader`, `action`, and `middleware` functions is always a `RouterContextProvider` instance + - `getLoadContext` functions in custom servers must return a `RouterContextProvider` — returning a plain object is no longer supported + - The `MiddlewareEnabled` type (previously exported as `UNSAFE_MiddlewareEnabled`) has been removed since the conditional it gated is now unconditional + - The `Future` module augmentation pattern (`interface Future { v8_middleware: true }`) is no longer needed to type `context` in Data Mode +- Update minimum Node version to 22.22.0 ([#14928](https://github.com/remix-run/react-router/pull/14928)) +- Update minimum React version to 19.2.7 ([#15062](https://github.com/remix-run/react-router/pull/15062)) + +### Minor Changes + +- Bump dependencies ([#15080](https://github.com/remix-run/react-router/pull/15080)) + - Bumped `cookie` from `^1.0.1` to `^1.1.1` + - Bumped `set-cookie-parser` from `^2.6.0` to `^3.1.0` + +### Patch Changes + +- Ensure client middleware errors load lazy route error boundaries before bubbling ([#15086](https://github.com/remix-run/react-router/pull/15086)) +- Remove explicit `onSubmit` type override from `SharedFormProps` to fix deprecation warning with `@types/react@19.x` ([#14932](https://github.com/remix-run/react-router/pull/14932)) ([59ebcf1](https://github.com/remix-run/react-router/commit/59ebcf1)) +- Update package builds to preserve individual module files in published artifacts. Public APIs and documented import paths are unchanged. ([#15092](https://github.com/remix-run/react-router/pull/15092)) + - Updated package TypeScript configs to support modern module syntax used by the build configuration. +- Migrate package builds from `tsup` to `tsdown`. Published package entry points and public APIs are unchanged. ([#15092](https://github.com/remix-run/react-router/pull/15092)) +- Upgrade React Router's TypeScript tooling to TypeScript 6. Runtime behavior and public APIs are unchanged. ([#15092](https://github.com/remix-run/react-router/pull/15092)) + ## v7.18.0 ### Patch Changes diff --git a/packages/react-router/lib/context.ts b/packages/react-router/lib/context.ts index 886b2afdcc..d071d8e836 100644 --- a/packages/react-router/lib/context.ts +++ b/packages/react-router/lib/context.ts @@ -55,7 +55,7 @@ export const ViewTransitionContext = }); ViewTransitionContext.displayName = "ViewTransition"; -// TODO: (v7) Change the useFetcher data from `any` to `unknown` +// TODO: (v9) Change the useFetcher data from `any` to `unknown` export type FetchersContextObject = Map; export const FetchersContext = React.createContext( diff --git a/packages/react-router/lib/dom/global.ts b/packages/react-router/lib/dom/global.ts index d844a32289..daef41d768 100644 --- a/packages/react-router/lib/dom/global.ts +++ b/packages/react-router/lib/dom/global.ts @@ -17,7 +17,7 @@ export interface ViewTransition { } declare global { - // TODO: v7 - Can this go away in favor of "just use remix"? + // TODO: (v9) Can this go away in favor of "just use remix"? var __staticRouterHydrationData: HydrationState | undefined; // v6 SPA info var __reactRouterVersion: string; diff --git a/packages/react-router/lib/dom/lib.tsx b/packages/react-router/lib/dom/lib.tsx index 69ef84f58f..6e01cb1584 100644 --- a/packages/react-router/lib/dom/lib.tsx +++ b/packages/react-router/lib/dom/lib.tsx @@ -2846,7 +2846,7 @@ export type FetcherWithComponents = Fetcher & { submit: FetcherSubmitFunction; }; -// TODO: (v7) Change the useFetcher generic default from `any` to `unknown` +// TODO: (v9) Change the useFetcher generic default from `any` to `unknown` /** * Useful for creating complex, dynamic user interfaces that require multiple, diff --git a/packages/react-router/lib/router/history.ts b/packages/react-router/lib/router/history.ts index 8a302cf6a8..5c6a72b438 100644 --- a/packages/react-router/lib/router/history.ts +++ b/packages/react-router/lib/router/history.ts @@ -51,7 +51,7 @@ export interface Path { hash: string; } -// TODO: (v7) Change the Location generic default from `any` to `unknown` and +// TODO: (v9) Change the Location generic default from `any` to `unknown` and // remove Remix `useLocation` wrapper. /** diff --git a/packages/react-router/lib/router/router.ts b/packages/react-router/lib/router/router.ts index bf5da65f95..a68036c589 100644 --- a/packages/react-router/lib/router/router.ts +++ b/packages/react-router/lib/router/router.ts @@ -343,7 +343,7 @@ export interface Router { * reflect the "old" location unless otherwise noted. */ export interface RouterState { - // TODO: (v7) should we consider renaming this `navigationType` to align with + // TODO: (v9) should we consider renaming this `navigationType` to align with // `useNavigationType` at some point? /** * The action of the most recent navigation @@ -2553,7 +2553,7 @@ export function createRouter(init: RouterInit): Router { if (pendingActionResult && !isErrorResult(pendingActionResult[1])) { // This is cast to `any` currently because `RouteData`uses any and it // would be a breaking change to use any. - // TODO: v7 - change `RouteData` to use `unknown` instead of `any` + // TODO: (v9) change `RouteData` to use `unknown` instead of `any` return { [pendingActionResult[0]]: pendingActionResult[1].data as any, }; @@ -5463,9 +5463,7 @@ function getMatchesToLoad( fetchLoadMatches.forEach((f, key) => { // Don't revalidate: // - on initial hydration (shouldn't be any fetchers then anyway) - // - if fetcher won't be present in the subsequent render - // - no longer matches the URL (v7_fetcherPersist=false) - // - was unmounted but persisted due to v7_fetcherPersist=true + // - if fetcher won't be present in the subsequent render (was unmounted but persisted) if ( initialHydration || !matches.some((m) => m.route.id === f.routeId) || diff --git a/packages/react-router/package.json b/packages/react-router/package.json index 1caddf1a0f..c78ffe3e52 100644 --- a/packages/react-router/package.json +++ b/packages/react-router/package.json @@ -1,7 +1,7 @@ { "name": "react-router", "type": "module", - "version": "8.0.0-pre.1", + "version": "8.0.0", "description": "Declarative routing for React", "keywords": [ "react", diff --git a/scripts/changes/publish.ts b/scripts/changes/publish.ts index 3d695ca22f..370da728f5 100644 --- a/scripts/changes/publish.ts +++ b/scripts/changes/publish.ts @@ -54,6 +54,11 @@ let { values } = parseArgs({ let skipCiCheck = values["skip-ci-check"]; let dryRun = values["dry-run"]; let branch = values.branch; + +if (!branch) { + throw new Error("--branch is required"); +} + let isLatest = branch === "main"; interface PublishedPackage { diff --git a/scripts/changes/whats-changed.md b/scripts/changes/whats-changed.md deleted file mode 100644 index c69b9abde3..0000000000 --- a/scripts/changes/whats-changed.md +++ /dev/null @@ -1,47 +0,0 @@ -### What's Changed - -React Router v8 is here! - -We introduced a new [Open Governance](https://remix.run/blog/rr-governance) model last year and this marks the first major release on our new planned yearly major release cadence. We chose the June timeframe this year to align with the EOL timeframe for Node 20. Node 22 is [scheduled](https://nodejs.org/en/about/previous-releases) to reach EOL in the May 2027 timeframe so we'll be aiming for a v9 release around the same time next year. - -Our [API Development Strategy](https://reactrouter.com/community/api-development-strategy) aims to make major releases relatively boring by introducing breaking changes ahead of time behind [Future flags](https://reactrouter.com/v7/upgrading/future). If you've adopted all active future flags in v7, then from a React Router API surface you're in good shape for v8. All `future.v8_*` flags have been removed (or lifted to a top-level config) and their behaviors are now the default. - -#### Baseline Support - -React Router v8 updates the following minimum supported versions: - -- Node 22.22.0+ - - Starting with v8, React Router will officially support all Active LTS node versions and only the **latest** minor branch of Maintenance LTS versions - - This better allows us to bump minimum Maintenance LTS versions to account for newly released security patches - - It also allows us to more quickly and easily adopt new Active LTS features backported to Maintenance LTS lines - - Upgraded minimum Maintenance LTS versions will be done in React Router minor releases -- React 19.2.7+ -- Vite 7+ - -To modernize the library, React Router is now published as an ESM-only module and tsconfig `target`/`lib` fields have been updated to ES2022 across the board - -#### Adopted Future Flag Behavior - -The following v8 future flags have been removed and their behaviors are now the default: - -- `future.v8_trailingSlashAwareDataRequests` -- `future.v8_passThroughRequests` -- `future.v8_middleware` -- `future.v8_viteEnvironmentApi` -- `future.v8_splitRouteModules` has been moved to a to a top-level `splitRouteModules` config option and is enabled by default - -#### Removed `react-router-dom` - -In v7, we collapsed the DOM APIs into `react-router/dom`, but to ease the v6->v7 upgrade we continued re-exporting everything through `react-router-dom`. We have now dropped `react-router-dom`, so if you didn't get around to swapping your imports in v7, you will need to swap them to `react-router` and `react-router/dom` for v8. - -#### Removed deprecated `meta` `data` fields - -The `data` fields passed to route module `meta` functions were deprecated in v7 and are remove din v8. Use `loaderData` instead of `data` on `MetaArgs` and each item in `MetaArgs.matches`. - -#### Cloudflare Vite Plugin - -The React Router Cloudflare dev proxy (`@react-router/dev/vite/cloudflare`) has been removed in v8. Cloudflare projects should use [`@cloudflare/vite-plugin`](https://developers.cloudflare.com/workers/vite-plugin/) instead. - -#### `@react-router/architect` `useRequestContextDomainName` - -The `@react-router/architect` `createRequestHandler` `useRequestContextDomainName` option has been removed as that is now the default behavior in v8. diff --git a/scripts/docs.ts b/scripts/docs.ts index e701f5ae0b..c23c233228 100644 --- a/scripts/docs.ts +++ b/scripts/docs.ts @@ -6,6 +6,7 @@ import fg from "fast-glob"; // @ts-expect-error import dox from "dox"; import prettier from "prettier"; +import * as semver from "semver"; import { ReflectionKind, type JSONOutput } from "typedoc"; import ts from "typescript"; @@ -163,7 +164,8 @@ const outputDir = args.output || "docs/api"; // Build lookup table for @link resolution const repoApiLookup = buildRepoDocsLinks(outputDir); -const typedocLookup = buildTypedocLinks(outputDir); +const reactRouterApiDocsVersion = getReactRouterApiDocsVersion(); +const typedocLookup = buildTypedocLinks(outputDir, reactRouterApiDocsVersion); run(); @@ -204,7 +206,23 @@ function buildRepoDocsLinks(outputDir: string): Map { return lookup; } -function buildTypedocLinks(outputDir: string) { +function getReactRouterApiDocsVersion() { + let packageJsonPath = "packages/react-router/package.json"; + let packageJson = JSON.parse(fs.readFileSync(packageJsonPath, "utf8")) as { + version?: string; + }; + let version = packageJson.version ? semver.parse(packageJson.version) : null; + + if (!version) { + throw new Error( + `Unable to detect React Router major version from ${packageJsonPath}`, + ); + } + + return `v${version.major}`; +} + +function buildTypedocLinks(outputDir: string, apiDocsVersion: string) { const lookup = new Map(); // Prerequisite: `typedoc` has been run first via `npm run docs` @@ -215,7 +233,7 @@ function buildTypedocLinks(outputDir: string) { apiData.children ?.filter((c) => c.kind === ReflectionKind.Module) - .forEach((child) => processTypedocModule(child, lookup)); + .forEach((child) => processTypedocModule(child, lookup, apiDocsVersion)); } else { warn( 'Typedoc API data not found at "public/dev/api.json", will not ' + @@ -229,6 +247,7 @@ function buildTypedocLinks(outputDir: string) { function processTypedocModule( child: JSONOutput.ReferenceReflection | JSONOutput.DeclarationReflection, lookup: Map, + apiDocsVersion: string, prefix: string[] = [], ) { let newPrefix = [...prefix, child.name]; @@ -236,7 +255,7 @@ function processTypedocModule( child.children?.forEach((subChild) => { // Recurse into submodules if (subChild.kind === ReflectionKind.Module) { - processTypedocModule(subChild, lookup, newPrefix); + processTypedocModule(subChild, lookup, apiDocsVersion, newPrefix); return; } @@ -289,7 +308,7 @@ function processTypedocModule( let modulePath = moduleName.replace(/[@/]/g, "_"); let path = `${type}/${modulePath}.${subChild.name}.html`; - let url = `https://api.reactrouter.com/v7/${path}`; + let url = `https://api.reactrouter.com/${apiDocsVersion}/${path}`; lookup.set(apiName, { href: url }); // When this is an interface, also include it's child properties in the lookup