Skip to content
2 changes: 1 addition & 1 deletion src/content/reference/react/startTransition.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ With a Transition, your UI stays responsive in the middle of a re-render. For ex

<Note>

`startTransition` is very similar to [`useTransition`](/reference/react/useTransition), except that it does not provide the `isPending` flag to track whether a Transition is ongoing. You can call `startTransition` when `useTransition` is not available. For example, `startTransition` works outside components, such as from a data library.
`startTransition` is very similar to [`useTransition`](/reference/react/useTransition), except that it does not provide the `isPending` flag to track whether a Transition is ongoing. The standalone function is also not associated with a component, so if the function passed to it throws an error or returns a rejected Promise, React reports the error with [`reportError`](https://developer.mozilla.org/en-US/docs/Web/API/Window/reportError). You can call `startTransition` when `useTransition` is not available. For example, `startTransition` works outside components, such as from a data library.

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

Expand Down
8 changes: 6 additions & 2 deletions src/content/reference/react/useTransition.md
Original file line number Diff line number Diff line change
Expand Up @@ -1567,7 +1567,7 @@ main {

### Displaying an error to users with an error boundary {/*displaying-an-error-to-users-with-error-boundary*/}

If a function passed to `startTransition` throws an error, you can display an error to your user with an [error boundary](/reference/react/Component#catching-rendering-errors-with-an-error-boundary). To use an error boundary, wrap the component where you are calling the `useTransition` in an error boundary. Once the function passed to `startTransition` errors, the fallback for the error boundary will be displayed.
If a function passed to `startTransition` throws an error or returns a rejected Promise, you can display an error to your user with an [error boundary](/reference/react/Component#catching-rendering-errors-with-an-error-boundary). To use an error boundary, wrap the component where you are calling the `useTransition` in an error boundary. Once the function passed to `startTransition` errors, the fallback for the error boundary will be displayed.

<Sandpack>

Expand Down Expand Up @@ -1738,7 +1738,11 @@ This is a JavaScript limitation due to React losing the scope of the async conte

### I want to call `useTransition` from outside a component {/*i-want-to-call-usetransition-from-outside-a-component*/}

You can't call `useTransition` outside a component because it's a Hook. In this case, use the standalone [`startTransition`](/reference/react/startTransition) method instead. It works the same way, but it doesn't provide the `isPending` indicator.
You can't call `useTransition` outside a component because it's a Hook. In this
case, the standalone [`startTransition`](/reference/react/startTransition)
function can mark state updates as Transitions. It does not provide the
`isPending` flag. Because the standalone function is not associated with a
component, an Error Boundary cannot handle errors from its Transition.

---

Expand Down
Loading