Rendering
Intermediate

Streaming and Suspense

Implement streaming SSR with Suspense for progressive page rendering and improved perceived performance.

25 min
3 sections
streaming
suspense
ssr
1
2
3

01. Understanding Suspense

Section 1 of 3

Suspense lets you defer rendering part of your UI until data is loaded, showing a fallback in the meantime.

typescript
import { Suspense } from 'react';

export default function Page() {
  return (
    <div>
      <h1>Dashboard</h1>
      <Suspense fallback={<Skeleton />}>
        <Stats />
      </Suspense>
      <Suspense fallback={<Skeleton />}>
        <Charts />
      </Suspense>
    </div>
  );
}

Exercise

Add Suspense to Slow Component

Practice

Wrap a slow-loading component in Suspense with a loading fallback.

Back to Course