Skip to content

Commit 1a41348

Browse files
committed
Update jsdocs
1 parent b4b91db commit 1a41348

File tree

3 files changed

+72
-16
lines changed

3 files changed

+72
-16
lines changed

packages/react-router/lib/components.tsx

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -379,15 +379,17 @@ export interface RouterProviderProps {
379379
* Control whether router state updates are internally wrapped in
380380
* [`React.startTransition`](https://react.dev/reference/react/startTransition).
381381
*
382-
* - When left `undefined` `undefined`, all state updates are wrapped in
382+
* - When left `undefined`, all state updates are wrapped in
383383
* `React.startTransition`. This can lead to buggy behaviors if you are
384-
* wrapping your own navigations/fetchers in `React.startTransition`.
385-
* - When set to true, all router navigations and state changes will be wrapped
386-
* in `React.startTransition` and state change swill also be sent through
384+
* wrapping your own navigations/fetchers in `startTransition`.
385+
* - When set to `true`, {@link Link} and {@link Form} navigations will be wrapped
386+
* in `React.startTransition` and router state changes will be set via
387387
* [`useOptimistic`](https://react.dev/reference/react/useOptimistic) to
388-
* surface mid-navigation router state changes to the UI
388+
* surface mid-navigation router state changes to the UI.
389389
* - When set to `false`, the router will not leverage `React.startTransition` or
390-
* `React.useOptimistic` on navigations or state changes.
390+
* `React.useOptimistic` on any navigations or state changes.
391+
*
392+
* For more information, please see the [docs](https://reactrouter.com/explanation/react-transitions).
391393
*/
392394
unstable_useTransitions?: boolean;
393395
}
@@ -795,7 +797,20 @@ export interface MemoryRouterProps {
795797
/**
796798
* Control whether router state updates are internally wrapped in
797799
* [`React.startTransition`](https://react.dev/reference/react/startTransition).
798-
* Enabled by default.
800+
*
801+
* - When left `undefined`, all state updates are wrapped in
802+
* `React.startTransition`. This can lead to buggy behaviors if you are
803+
* wrapping your own navigations/fetchers in `startTransition`.
804+
* - When set to `true`, {@link Link} and {@link Form} navigations will be wrapped
805+
* in `React.startTransition` and router state changes will be set via
806+
* [`useOptimistic`](https://react.dev/reference/react/useOptimistic) to
807+
* surface mid-navigation router state changes to the UI.
808+
* - Because navigations are synchronous in Declarative Mode, this
809+
* `useOptimistic` aspect shouldn't have any impact on the UI
810+
* - When set to `false`, the router will not leverage `React.startTransition` or
811+
* `React.useOptimistic` on any navigations or state changes.
812+
*
813+
* For more information, please see the [docs](https://reactrouter.com/explanation/react-transitions).
799814
*/
800815
unstable_useTransitions?: boolean;
801816
}

packages/react-router/lib/dom-export/hydrated-router.tsx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -302,15 +302,17 @@ export interface HydratedRouterProps {
302302
* Control whether router state updates are internally wrapped in
303303
* [`React.startTransition`](https://react.dev/reference/react/startTransition).
304304
*
305-
* - When left `undefined` `undefined`, all state updates are wrapped in
305+
* - When left `undefined`, all state updates are wrapped in
306306
* `React.startTransition`. This can lead to buggy behaviors if you are
307-
* wrapping your own navigations/fetchers in `React.startTransition`.
308-
* - When set to true, all router navigations and state changes will be wrapped
309-
* in `React.startTransition` and state change swill also be sent through
307+
* wrapping your own navigations/fetchers in `startTransition`.
308+
* - When set to `true`, {@link Link} and {@link Form} navigations will be wrapped
309+
* in `React.startTransition` and router state changes will be set via
310310
* [`useOptimistic`](https://react.dev/reference/react/useOptimistic) to
311-
* surface mid-navigation router state changes to the UI
311+
* surface mid-navigation router state changes to the UI.
312312
* - When set to `false`, the router will not leverage `React.startTransition` or
313-
* `React.useOptimistic` on navigations or state changes.
313+
* `React.useOptimistic` on any navigations or state changes.
314+
*
315+
* For more information, please see the [docs](https://reactrouter.com/explanation/react-transitions).
314316
*/
315317
unstable_useTransitions?: boolean;
316318
}

packages/react-router/lib/dom/lib.tsx

Lines changed: 42 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -935,7 +935,20 @@ export interface BrowserRouterProps {
935935
/**
936936
* Control whether router state updates are internally wrapped in
937937
* [`React.startTransition`](https://react.dev/reference/react/startTransition).
938-
* Enabled by default.
938+
*
939+
* - When left `undefined`, all state updates are wrapped in
940+
* `React.startTransition`. This can lead to buggy behaviors if you are
941+
* wrapping your own navigations/fetchers in `startTransition`.
942+
* - When set to `true`, {@link Link} and {@link Form} navigations will be wrapped
943+
* in `React.startTransition` and router state changes will be set via
944+
* [`useOptimistic`](https://react.dev/reference/react/useOptimistic) to
945+
* surface mid-navigation router state changes to the UI.
946+
* - Because navigations are synchronous in Declarative Mode, this
947+
* `useOptimistic` aspect shouldn't have any impact on the UI
948+
* - When set to `false`, the router will not leverage `React.startTransition` or
949+
* `React.useOptimistic` on any navigations or state changes.
950+
*
951+
* For more information, please see the [docs](https://reactrouter.com/explanation/react-transitions).
939952
*/
940953
unstable_useTransitions?: boolean;
941954
/**
@@ -1016,7 +1029,20 @@ export interface HashRouterProps {
10161029
/**
10171030
* Control whether router state updates are internally wrapped in
10181031
* [`React.startTransition`](https://react.dev/reference/react/startTransition).
1019-
* Enabled by default.
1032+
*
1033+
* - When left `undefined`, all state updates are wrapped in
1034+
* `React.startTransition`. This can lead to buggy behaviors if you are
1035+
* wrapping your own navigations/fetchers in `startTransition`.
1036+
* - When set to `true`, {@link Link} and {@link Form} navigations will be wrapped
1037+
* in `React.startTransition` and router state changes will be set via
1038+
* [`useOptimistic`](https://react.dev/reference/react/useOptimistic) to
1039+
* surface mid-navigation router state changes to the UI.
1040+
* - Because navigations are synchronous in Declarative Mode, this
1041+
* `useOptimistic` aspect shouldn't have any impact on the UI
1042+
* - When set to `false`, the router will not leverage `React.startTransition` or
1043+
* `React.useOptimistic` on any navigations or state changes.
1044+
*
1045+
* For more information, please see the [docs](https://reactrouter.com/explanation/react-transitions).
10201046
*/
10211047
unstable_useTransitions?: boolean;
10221048
/**
@@ -1102,7 +1128,20 @@ export interface HistoryRouterProps {
11021128
/**
11031129
* Control whether router state updates are internally wrapped in
11041130
* [`React.startTransition`](https://react.dev/reference/react/startTransition).
1105-
* Enabled by default.
1131+
*
1132+
* - When left `undefined`, all state updates are wrapped in
1133+
* `React.startTransition`. This can lead to buggy behaviors if you are
1134+
* wrapping your own navigations/fetchers in `startTransition`.
1135+
* - When set to `true`, {@link Link} and {@link Form} navigations will be wrapped
1136+
* in `React.startTransition` and router state changes will be set via
1137+
* [`useOptimistic`](https://react.dev/reference/react/useOptimistic) to
1138+
* surface mid-navigation router state changes to the UI.
1139+
* - Because navigations are synchronous in Declarative Mode, this
1140+
* `useOptimistic` aspect shouldn't have any impact on the UI
1141+
* - When set to `false`, the router will not leverage `React.startTransition` or
1142+
* `React.useOptimistic` on any navigations or state changes.
1143+
*
1144+
* For more information, please see the [docs](https://reactrouter.com/explanation/react-transitions).
11061145
*/
11071146
unstable_useTransitions?: boolean;
11081147
}

0 commit comments

Comments
 (0)