diff --git a/src/content/reference/react/startTransition.md b/src/content/reference/react/startTransition.md index fba28f6d1bc..1da920d5e92 100644 --- a/src/content/reference/react/startTransition.md +++ b/src/content/reference/react/startTransition.md @@ -92,7 +92,7 @@ With a Transition, your UI stays responsive in the middle of a re-render. For ex -`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) diff --git a/src/content/reference/react/useTransition.md b/src/content/reference/react/useTransition.md index 472224e58d9..6533a201bf3 100644 --- a/src/content/reference/react/useTransition.md +++ b/src/content/reference/react/useTransition.md @@ -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. @@ -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. ---