Courses / React 19: From Components to Production / Chapter 14
Module 7 · Suspense, Streaming and Server Components · Chapter 14 of 30
Suspense, Streaming SSR and Code-Splitting
Builds on New in React 19: Actions, use, Optimistic UI and ref as a Prop, Concurrent Rendering: Transitions, Deferred Values and Priorities and Rendering Internals and Performance: Fiber, Memo and the Compiler. Next up: Server Components: The Client Boundary, Server Functions and Caching.
Part 1 · Suspense boundaries and reveal order
What suspends and what shows meanwhile
A regional news site wants the headline on screen at once and the comments whenever they arrive. Suspense is the React feature that lets one page appear in pieces like that.
A component suspends when it cannot render yet because something it needs has not arrived. React stops rendering that component and shows the fallback of the nearest Suspense boundary above it. When the missing thing arrives, React tries the component again. The react.dev reference lists what can make a component suspend: code loaded with lazy, a promise read with use, a stylesheet rendered with a precedence prop, and large boundaries during streaming server rendering.
The same page says what does not suspend. Data fetched inside an effect or an event handler does not activate Suspense, so a component that fetches that way has to show its own loading state.
A boundary is <Suspense fallback={...}> wrapped around part of the tree. Everything inside it waits as one unit: siblings in the same boundary appear together, because React does not show some of them while another is still missing. Boundaries nest, and nesting gives a loading sequence. The outer boundary reveals as soon as its own content is ready, and an inner boundary can keep showing its fallback while the rest of the page is already visible.