Reading stable promises with use and Suspense
The new use API
Read an existing, stable promise during render with use. Suspense supplies the pending fallback; an Error Boundary handles rejection. Create/cache the promise outside render or use framework-supported data fetching. Effects still synchronize external systems and remain useful for some client-side requests.
👀 Preview
The screen shows "Loading Profile..."....network request finishes...Instantly snaps to "Cristian" without a single useEffect.
📚 Explanation
React 19's `use` hook allows you to unwrap promises directly in render. Combined with Suspense, this eliminates the need for manual loading state management. The component automatically suspends until the promise resolves.
How well did you remember this?