Reactreactsuspensestreamingperformanceproduction-ready
Streaming with Nested Suspense
Nested Suspense boundaries for progressive page loading that streams critical content first while deferring non-essential sections.
title: "Streaming with Nested Suspense" description: "Nested Suspense boundaries for progressive page loading that streams critical content first while deferring non-essential sections." category: "React" language: "typescript" tags: ["react", "suspense", "streaming", "performance", "production-ready"] createdAt: "2025-03-12" updatedAt: "2025-04-01"
Overview
A streaming page architecture that uses nested Suspense boundaries to progressively reveal content as data loads. Each section is an independent async component that streams to the client when its data resolves, eliminating waterfall loading patterns.
Code
<Suspense fallback={<Skeleton />}>
<SlowComponent /> {/* Streams in when ready */}
</Suspense>Notes
- Each Suspense boundary is an independent streaming slot; the page shell sends immediately
- Individual KPI cards each have their own boundary so they appear as soon as their data loads
- Skeletons should match the rendered layout dimensions to prevent layout shift (CLS)
- Place boundaries at visual section breaks for the best perceived performance
- Suspense only catches async components and lazy-loaded components, not useEffect fetches