Skip to content

Commit 2e8639d

Browse files
committed
chore: generate markdown docs from jsdocs
1 parent 707ecef commit 2e8639d

File tree

7 files changed

+111
-3
lines changed

7 files changed

+111
-3
lines changed

docs/api/data-routers/RouterProvider.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ function RouterProvider({
4949
router,
5050
flushSync: reactDomFlushSyncImpl,
5151
unstable_onError,
52+
unstable_useTransitions,
5253
}: RouterProviderProps): React.ReactElement
5354
```
5455

@@ -86,3 +87,22 @@ and is only present for render errors.
8687

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

90+
### unstable_useTransitions
91+
92+
Control whether router state updates are internally wrapped in
93+
[`React.startTransition`](https://react.dev/reference/react/startTransition).
94+
95+
- When left `undefined`, all state updates are wrapped in
96+
`React.startTransition`
97+
- This can lead to buggy behaviors if you are wrapping your own
98+
navigations/fetchers in `startTransition`.
99+
- When set to `true`, [`Link`](../components/Link) and [`Form`](../components/Form) navigations will be wrapped
100+
in `React.startTransition` and router state changes will be wrapped in
101+
`React.startTransition` and also sent through
102+
[`useOptimistic`](https://react.dev/reference/react/useOptimistic) to
103+
surface mid-navigation router state changes to the UI.
104+
- When set to `false`, the router will not leverage `React.startTransition` or
105+
`React.useOptimistic` on any navigations or state changes.
106+
107+
For more information, please see the [docs](https://reactrouter.com/explanation/react-transitions).
108+

docs/api/declarative-routers/BrowserRouter.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,12 @@ API for client-side routing.
2828
## Signature
2929

3030
```tsx
31-
function BrowserRouter({ basename, children, window }: BrowserRouterProps)
31+
function BrowserRouter({
32+
basename,
33+
children,
34+
unstable_useTransitions,
35+
window,
36+
}: BrowserRouterProps)
3237
```
3338

3439
## Props
@@ -41,6 +46,21 @@ Application basename
4146

4247
``<Route>`` components describing your route configuration
4348

49+
### unstable_useTransitions
50+
51+
Control whether router state updates are internally wrapped in
52+
[`React.startTransition`](https://react.dev/reference/react/startTransition).
53+
54+
- When left `undefined`, all router state updates are wrapped in
55+
`React.startTransition`
56+
- When set to `true`, [`Link`](../components/Link) and [`Form`](../components/Form) navigations will be wrapped
57+
in `React.startTransition` and all router state updates are wrapped in
58+
`React.startTransition`
59+
- When set to `false`, the router will not leverage `React.startTransition`
60+
on any navigations or state changes.
61+
62+
For more information, please see the [docs](https://reactrouter.com/explanation/react-transitions).
63+
4464
### window
4565

4666
[`Window`](https://developer.mozilla.org/en-US/docs/Web/API/Window) object

docs/api/declarative-routers/HashRouter.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,12 @@ of the URL so it is not sent to the server.
2929
## Signature
3030

3131
```tsx
32-
function HashRouter({ basename, children, window }: HashRouterProps)
32+
function HashRouter({
33+
basename,
34+
children,
35+
unstable_useTransitions,
36+
window,
37+
}: HashRouterProps)
3338
```
3439

3540
## Props
@@ -42,6 +47,21 @@ Application basename
4247

4348
``<Route>`` components describing your route configuration
4449

50+
### unstable_useTransitions
51+
52+
Control whether router state updates are internally wrapped in
53+
[`React.startTransition`](https://react.dev/reference/react/startTransition).
54+
55+
- When left `undefined`, all router state updates are wrapped in
56+
`React.startTransition`
57+
- When set to `true`, [`Link`](../components/Link) and [`Form`](../components/Form) navigations will be wrapped
58+
in `React.startTransition` and all router state updates are wrapped in
59+
`React.startTransition`
60+
- When set to `false`, the router will not leverage `React.startTransition`
61+
on any navigations or state changes.
62+
63+
For more information, please see the [docs](https://reactrouter.com/explanation/react-transitions).
64+
4565
### window
4666

4767
[`Window`](https://developer.mozilla.org/en-US/docs/Web/API/Window) object

docs/api/declarative-routers/HistoryRouter.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,12 @@ the same version of the `history` library that React Router uses internally.
3939
## Signature
4040

4141
```tsx
42-
function HistoryRouter({ basename, children, history }: HistoryRouterProps)
42+
function HistoryRouter({
43+
basename,
44+
children,
45+
history,
46+
unstable_useTransitions,
47+
}: HistoryRouterProps)
4348
```
4449

4550
## Props
@@ -56,3 +61,18 @@ Application basename
5661

5762
A `History` implementation for use by the router
5863

64+
### unstable_useTransitions
65+
66+
Control whether router state updates are internally wrapped in
67+
[`React.startTransition`](https://react.dev/reference/react/startTransition).
68+
69+
- When left `undefined`, all router state updates are wrapped in
70+
`React.startTransition`
71+
- When set to `true`, [`Link`](../components/Link) and [`Form`](../components/Form) navigations will be wrapped
72+
in `React.startTransition` and all router state updates are wrapped in
73+
`React.startTransition`
74+
- When set to `false`, the router will not leverage `React.startTransition`
75+
on any navigations or state changes.
76+
77+
For more information, please see the [docs](https://reactrouter.com/explanation/react-transitions).
78+

docs/api/declarative-routers/MemoryRouter.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ function MemoryRouter({
3232
children,
3333
initialEntries,
3434
initialIndex,
35+
unstable_useTransitions,
3536
}: MemoryRouterProps): React.ReactElement
3637
```
3738

@@ -53,3 +54,18 @@ Initial entries in the in-memory history stack
5354

5455
Index of `initialEntries` the application should initialize to
5556

57+
### unstable_useTransitions
58+
59+
Control whether router state updates are internally wrapped in
60+
[`React.startTransition`](https://react.dev/reference/react/startTransition).
61+
62+
- When left `undefined`, all router state updates are wrapped in
63+
`React.startTransition`
64+
- When set to `true`, [`Link`](../components/Link) and [`Form`](../components/Form) navigations will be wrapped
65+
in `React.startTransition` and all router state updates are wrapped in
66+
`React.startTransition`
67+
- When set to `false`, the router will not leverage `React.startTransition`
68+
on any navigations or state changes.
69+
70+
For more information, please see the [docs](https://reactrouter.com/explanation/react-transitions).
71+

docs/api/declarative-routers/Router.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ function Router({
3838
navigationType = NavigationType.Pop,
3939
navigator,
4040
static: staticProp = false,
41+
unstable_useTransitions,
4142
}: RouterProps): React.ReactElement | null
4243
```
4344

@@ -71,3 +72,7 @@ or a custom navigator that implements the [`Navigator`](https://api.reactrouter.
7172
Whether this router is static or not (used for SSR). If `true`, the router
7273
will not be reactive to location changes.
7374

75+
### unstable_useTransitions
76+
77+
Whether this router should wrap navigations in `React.startTransition()`
78+

docs/api/hooks/useLinkClickHandler.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,15 @@ function useLinkClickHandler<E extends Element = HTMLAnchorElement>(
3838
preventScrollReset,
3939
relative,
4040
viewTransition,
41+
unstable_useTransitions,
4142
}: {
4243
target?: React.HTMLAttributeAnchorTarget;
4344
replace?: boolean;
4445
state?: any;
4546
preventScrollReset?: boolean;
4647
relative?: RelativeRoutingType;
4748
viewTransition?: boolean;
49+
unstable_useTransitions?: boolean;
4850
} = ,
4951
): (event: React.MouseEvent<E, MouseEvent>) => void {}
5052
```
@@ -81,6 +83,11 @@ The target attribute for the link. Defaults to `undefined`.
8183
Enables a [View Transition](https://developer.mozilla.org/en-US/docs/Web/API/View_Transitions_API) for this navigation. To apply specific styles during the transition, see
8284
[`useViewTransitionState`](../hooks/useViewTransitionState). Defaults to `false`.
8385

86+
### options.unstable_useTransitions
87+
88+
Wraps the navigation in [`React.startTransition`](https://react.dev/reference/react/startTransition)
89+
for concurrent rendering. Defaults to `false`.
90+
8491
## Returns
8592

8693
A click handler function that can be used in a custom [`Link`](../components/Link) component.

0 commit comments

Comments
 (0)