Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/api/components/Await.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/v7/functions/react-router.Await.html)

Used to render promise values with automatic error handling.

Expand Down
6 changes: 3 additions & 3 deletions docs/api/components/Form.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/v7/functions/react-router.Form.html)

A progressively enhanced HTML [`<form>`](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),
Expand All @@ -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 [`<fetcher.Form>`](https://api.reactrouter.com/v7/types/react_router.FetcherWithComponents.html#Form).
stack, use [`<fetcher.Form>`](https://api.reactrouter.com/v7/types/react-router.FetcherWithComponents.html#Form).

```tsx
import { Form } from "react-router";
Expand Down Expand Up @@ -120,7 +120,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/v7/types/react-router.RelativeRoutingType.html).

### reloadDocument

Expand Down
4 changes: 2 additions & 2 deletions docs/api/components/Link.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/v7/functions/react-router.Link.html)

A progressively enhanced [`<a href>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a)
wrapper to enable navigation with client-side routing.
Expand Down Expand Up @@ -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/v7/interfaces/react-router.Path.html):

```tsx
<Link to="/some/path" />
Expand Down
2 changes: 1 addition & 1 deletion docs/api/components/Links.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/v7/functions/react-router.Links.html)

Renders all the [`<link>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link)
tags created by the route module's [`links`](../../start/framework/route-module#links)
Expand Down
2 changes: 1 addition & 1 deletion docs/api/components/Meta.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/v7/functions/react-router.Meta.html)

Renders all the [`<meta>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta)
tags created by the route module's [`meta`](../../start/framework/route-module#meta)
Expand Down
14 changes: 7 additions & 7 deletions docs/api/components/NavLink.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/v7/functions/react-router.NavLink.html)

Wraps [`<Link>`](../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/v7/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/v7/types/react-router.NavLinkRenderProps.html).

```tsx
<NavLink to="/message">Messages</NavLink>
Expand Down Expand Up @@ -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/v7/types/react-router.NavLinkRenderProps.html) and
returns the `className`:

```tsx
Expand Down Expand Up @@ -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/v7/interfaces/react-router.NavLinkProps.html#to). If the URL is longer, it will no
longer be considered active.

| Link | URL | isActive |
Expand Down Expand Up @@ -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/v7/types/react-router.NavLinkRenderProps.html) and returns the styles:

```tsx
<NavLink to="/tasks" style={{ color: "red" }} />
Expand All @@ -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/v7/interfaces/react-router.Path.html):

```tsx
<Link to="/some/path" />
Expand Down
8 changes: 4 additions & 4 deletions docs/api/components/Navigate.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/v7/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
Expand All @@ -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/v7/types/react-router.RelativeRoutingType.html).

### replace

Expand All @@ -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/v7/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/v7/interfaces/react-router.Path.html) object

2 changes: 1 addition & 1 deletion docs/api/components/Outlet.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/v7/functions/react-router.Outlet.html)

Renders the matching child route of a parent route or nothing if no child
route matches.
Expand Down
2 changes: 1 addition & 1 deletion docs/api/components/PrefetchPageLinks.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/v7/functions/react-router.PrefetchPageLinks.html)

Renders [`<link rel=prefetch|modulepreload>`](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
Expand Down
4 changes: 2 additions & 2 deletions docs/api/components/Route.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/v7/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
Expand Down Expand Up @@ -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/v7/interfaces/react-router.DataRouter.html)s)

### index

Expand Down
4 changes: 2 additions & 2 deletions docs/api/components/Routes.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/v7/functions/react-router.Routes.html)

Renders a branch of [`<Route>`s](../components/Route) that best matches the current
location. Note that these routes do not participate in [data loading](../../start/framework/route-module#loader),
Expand Down Expand Up @@ -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/v7/interfaces/react-router.Location.html) to match against. Defaults to the current location.

2 changes: 1 addition & 1 deletion docs/api/components/Scripts.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/v7/functions/react-router.Scripts.html)

Renders the client runtime of your app. It should be rendered inside the
[`<body>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/body)
Expand Down
4 changes: 2 additions & 2 deletions docs/api/components/ScrollRestoration.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/v7/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.

Expand Down Expand Up @@ -62,7 +62,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/v7/interfaces/react-router.GetScrollRestorationKeyFunction.html).

```tsx
<ScrollRestoration
Expand Down
6 changes: 3 additions & 3 deletions docs/api/data-routers/RouterProvider.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.RouterProvider.html)
[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react-router.RouterProvider.html)

Render the UI for the given [`DataRouter`](https://api.reactrouter.com/v7/interfaces/react_router.DataRouter.html). This component should
Render the UI for the given [`DataRouter`](https://api.reactrouter.com/v7/interfaces/react-router.DataRouter.html). This component should
typically be at the top of an app's element tree.

```tsx
Expand Down Expand Up @@ -86,7 +86,7 @@ and is only present for render errors.

### router

The [`DataRouter`](https://api.reactrouter.com/v7/interfaces/react_router.DataRouter.html) instance to use for navigation and data fetching.
The [`DataRouter`](https://api.reactrouter.com/v7/interfaces/react-router.DataRouter.html) instance to use for navigation and data fetching.

### unstable_useTransitions

Expand Down
8 changes: 4 additions & 4 deletions docs/api/data-routers/StaticRouterProvider.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.StaticRouterProvider.html)
[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react-router.StaticRouterProvider.html)

A [`DataRouter`](https://api.reactrouter.com/v7/interfaces/react_router.DataRouter.html) that may not navigate to any other [`Location`](https://api.reactrouter.com/v7/interfaces/react_router.Location.html).
A [`DataRouter`](https://api.reactrouter.com/v7/interfaces/react-router.DataRouter.html) that may not navigate to any other [`Location`](https://api.reactrouter.com/v7/interfaces/react-router.Location.html).
This is useful on the server where there is no stateful UI.

```tsx
Expand Down Expand Up @@ -57,7 +57,7 @@ function StaticRouterProvider({

### 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
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`

### hydrate
Expand All @@ -72,5 +72,5 @@ tag

### router

The static [`DataRouter`](https://api.reactrouter.com/v7/interfaces/react_router.DataRouter.html) from [`createStaticRouter`](../data-routers/createStaticRouter)
The static [`DataRouter`](https://api.reactrouter.com/v7/interfaces/react-router.DataRouter.html) from [`createStaticRouter`](../data-routers/createStaticRouter)

10 changes: 5 additions & 5 deletions docs/api/data-routers/createBrowserRouter.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.createBrowserRouter.html)
[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react-router.createBrowserRouter.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/v7/interfaces/react-router.DataRouter.html) that manages the application
path via [`history.pushState`](https://developer.mozilla.org/en-US/docs/Web/API/History/pushState)
and [`history.replaceState`](https://developer.mozilla.org/en-US/docs/Web/API/History/replaceState).

Expand Down Expand Up @@ -108,7 +108,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/v7/interfaces/react-router.StaticHandlerContext.html) value you get back from the [`StaticHandler`](https://api.reactrouter.com/v7/interfaces/react-router.StaticHandler.html)'s
`query` method:

```tsx
Expand Down Expand Up @@ -224,7 +224,7 @@ async function logExecution(label: string, impl: () => Promise<void>) {
### 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/v7/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
Expand Down Expand Up @@ -526,5 +526,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 [`<RouterProvider>`](../data-routers/RouterProvider)
An initialized [data router](https://api.reactrouter.com/v7/interfaces/react-router.DataRouter.html) to pass to [`<RouterProvider>`](../data-routers/RouterProvider)

Loading