Skip to content

Commit 73e0b39

Browse files
committed
Preserve existing startTransition guidance
1 parent 790edb8 commit 73e0b39

1 file changed

Lines changed: 9 additions & 13 deletions

File tree

‎src/content/reference/react/startTransition.md‎

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,7 @@ function TabContainer() {
5353

5454
* You can wrap an update into a Transition only if you have access to the `set` function of that state. If you want to start a Transition in response to some prop or a custom Hook return value, try [`useDeferredValue`](/reference/react/useDeferredValue) instead.
5555

56-
* The function you pass to `startTransition` is called immediately, marking all
57-
state updates that happen while it executes as Transitions. If you try to
58-
perform state updates in a `setTimeout`, for example, they won't be marked as
59-
Transitions. If the function throws an error or returns a rejected Promise,
60-
React reports the error as uncaught because the standalone `startTransition`
61-
function is not associated with a component. [Learn how to display errors
62-
from `useTransition` with an Error
63-
Boundary.](/reference/react/useTransition#displaying-an-error-to-users-with-error-boundary)
56+
* The function you pass to `startTransition` is called immediately, marking all state updates that happen while it executes as Transitions. If you try to perform state updates in a `setTimeout`, for example, they won't be marked as Transitions.
6457

6558
* You must wrap any state updates after any async requests in another `startTransition` to mark them as Transitions. This is a known limitation that we will fix in the future (see [Troubleshooting](/reference/react/useTransition#react-doesnt-treat-my-state-update-after-await-as-a-transition)).
6659

@@ -99,11 +92,14 @@ With a Transition, your UI stays responsive in the middle of a re-render. For ex
9992

10093
<Note>
10194

102-
The standalone `startTransition` and the function returned by
103-
[`useTransition`](/reference/react/useTransition) both mark state updates as
104-
Transitions. Unlike `useTransition`, the standalone function does not provide
105-
the `isPending` flag. It is not a Hook, so you can call it outside components.
106-
[See Caveats.](#caveats)
95+
`startTransition` is very similar to
96+
[`useTransition`](/reference/react/useTransition), except that it does not
97+
provide the `isPending` flag to track whether a Transition is ongoing. The
98+
standalone function is also not associated with a component, so if the function
99+
passed to it throws an error or returns a rejected Promise, React reports the
100+
error as uncaught. You can call `startTransition` when `useTransition` is not
101+
available. For example, `startTransition` works outside components, such as from
102+
a data library.
107103

108104
[Learn about Transitions and see examples on the `useTransition` page.](/reference/react/useTransition)
109105

0 commit comments

Comments
 (0)