The home where you level up โ daily 3-minute lessons.
Save my spotfunction Page({ commentsPromise }) {
const comments = use(commentsPromise);
return <Comments items={comments} />;
}function Page({ commentsPromise }) {
return (
<Suspense fallback={<Spinner />}>
<Comments promise={commentsPromise} />
</Suspense>
);
}The component that suspends must be inside the boundary, so the fallback shows while only that part waits for data.
useEffect and never seeing the fallback.use(), lazy() or a Suspense-enabled framework, not from fetch inside useEffect.<Suspense> boundary is placed around a meaningful UI section, not around the whole app only.<Suspense> boundary to handle rejected promises.startTransition instead of showing the fallback again.No. Suspense only reacts to sources that suspend during render, such as use() with a promise, lazy() or framework data loaders.
Wrap the update that triggers loading in startTransition, and React keeps the old content visible while new data loads.
Yes. With streaming server rendering, the fallback is sent first and the content streams in when its data is ready.

Daily 3-minute lessons to understand your AI's code.