Skip to content

Commit e144665

Browse files
committed
Describe startTransition differences neutrally
1 parent fe295e6 commit e144665

2 files changed

Lines changed: 13 additions & 11 deletions

File tree

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

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

5454
* The standalone `startTransition` function is not associated with a component.
5555
If the `action` throws an error or returns a rejected Promise, React reports
56-
the error as uncaught, and an Error Boundary does not handle it. To let the
57-
nearest Error Boundary handle these errors, use the `startTransition`
58-
function returned by
59-
[`useTransition`](/reference/react/useTransition#displaying-an-error-to-users-with-error-boundary).
56+
the error as uncaught, and an Error Boundary does not handle it. In contrast,
57+
the `startTransition` function returned by
58+
[`useTransition`](/reference/react/useTransition#displaying-an-error-to-users-with-error-boundary)
59+
is associated with a component, so the nearest Error Boundary can handle
60+
these errors.
6061

6162
* 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.
6263

@@ -99,11 +100,12 @@ With a Transition, your UI stays responsive in the middle of a re-render. For ex
99100

100101
<Note>
101102

102-
`startTransition` does not provide the `isPending` flag. Call it from code that
103-
cannot call Hooks, such as data-library code outside a component. Unlike the
104-
function returned by [`useTransition`](/reference/react/useTransition), the
105-
standalone `startTransition` is not associated with a component. As a result,
106-
an Error Boundary cannot handle errors from its Action. [See Caveats.](#caveats)
103+
The standalone `startTransition` and the function returned by
104+
[`useTransition`](/reference/react/useTransition) both mark state updates as
105+
Transitions. The standalone function does not provide the `isPending` flag and
106+
is not associated with a component, so an Error Boundary cannot handle errors
107+
from its Action. Unlike `useTransition`, the standalone `startTransition` is not
108+
a Hook and can be called outside components. [See Caveats.](#caveats)
107109

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

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1744,8 +1744,8 @@ This is a JavaScript limitation due to React losing the scope of the async conte
17441744
### I want to call `useTransition` from outside a component {/*i-want-to-call-usetransition-from-outside-a-component*/}
17451745
17461746
You can't call `useTransition` outside a component because it's a Hook. In this
1747-
case, use the standalone [`startTransition`](/reference/react/startTransition)
1748-
function instead. It marks state updates as Transitions but does not provide the
1747+
case, the standalone [`startTransition`](/reference/react/startTransition)
1748+
function can mark state updates as Transitions. It does not provide the
17491749
`isPending` flag. Because the standalone function is not associated with a
17501750
component, an Error Boundary cannot handle errors from its Action.
17511751

0 commit comments

Comments
 (0)