const user = use(userPromise) reads a promise during render:
- Fulfilled:
usereturns the value. - Rejected: it throws the rejection reason, which the nearest error boundary displays.
- Pending: the component suspends and the nearest
<Suspense>shows its fallback. React attaches handlers that recordstatusandvalueon the promise; when it settles, React renders the component again, and this timeusereturns synchronously.
That retry is why the promise must be cached. The second render has to receive the same promise object to find it settled. A component that suspended before mounting has no state, so React reruns it from scratch; a promise created in render, like use(fetch(url).then(…)), is a new pending promise every time. The component suspends again, the new promise settles, it suspends again, and the content never appears. A mounted component that re-renders hits the same trap.
So create the promise outside render and reuse it:
- a cache keyed by input (a module-level
Map, or a data library), - a Suspense-enabled framework, which caches for you,
- a Server Component passing a promise prop,
- an event handler that stores the promise in state, inside
startTransitionso the old content stays while the new promise loads.
Not quite a Hook. use must be called during render of a component or Hook, but it may sit inside if blocks and loops. It may not sit inside try/catch: it suspends by throwing, so handle rejections with an error boundary, or give use a cached promise.catch(…) that resolves to a fallback value. Always call use for the promise itself rather than reading promise.status to skip it; React 19.3 warns about that.
use(Context) reads context like useContext, also conditionally.