React · Middle · Question 28 of 75
How does React 19's use(promise) differ from regular hooks?
- ✓Correct answer: It can be called inside conditions; it suspends rendering
- 2It works only in React 19 class components
- 3It restarts the promise on every render and caches it
Explanation
use reads the value of a promise or context. Until the promise resolves, the nearest <Suspense> kicks in, and an error goes to the error boundary. Don't create the promise during a client component's render - it'll be new every time; pass it from a Server Component or a caching library.