Skip to content
Learn Netverks

Lesson

Step 32/36 89% through track

streaming-suspense

Streaming and Suspense

Last reviewed May 28, 2026 Content v20260528
Track mode
client_nextjs
Means
In-browser Next.js (client components)
Reading
~1 min
Level
advanced

This lesson

This lesson teaches Streaming and Suspense: the concepts, APIs, and habits you need before advancing in Next.js.

Without Streaming and Suspense, you will struggle to read or extend Next.js codebases and playground exercises.

You will apply Streaming and Suspense in contexts like: Marketing sites, dashboards, e-commerce, and Vercel-style deployments that need hybrid static + dynamic pages.

Write TSX for Client Components, click Run—React 18 CDN + in-browser TSX compile; use client/server lessons explain App Router concepts; mountApp renders interactive UI; printOutput feeds the terminal.

When hooks, state, and effects from intermediate lessons are familiar.

Streaming sends HTML to the browser in chunks as Server Components resolve. Suspense marks boundaries where fallback UI shows until async children finish.

Automatic with loading.tsx

Placing loading.tsx in a segment creates a Suspense boundary—no manual wrapper required for that case.

Manual Suspense

import { Suspense } from 'react';

export default function Page() {
  return (
    <>
      <h1>Dashboard</h1>
      <Suspense fallback={<p>Loading chart…</p>}>
        <SlowChart />
      </Suspense>
    </>
  );
}

UX payoff

Users see layout and fast sections immediately; slow widgets fill in—better than a blank screen until everything finishes.

Self-check

  1. How does streaming improve perceived performance?
  2. What is the relationship between loading.tsx and Suspense?

Challenge

Stream simulation

  1. Click Stream page and watch fast shell appear before slow block.

Done when: fast header shows immediately; slow section appears after delay.

Tip: loading.tsx is Suspense with zero boilerplate—add manual <Suspense> when multiple independent slow blocks need separate fallbacks.

Interview tip Lesson completion confidence

Can you explain this lesson in 30 seconds without reading notes?

Not saved yet.

Playground

Runs in your browser in a sandboxed frame. Backend runners appear when this track’s profile allows them.

Check yourself

Multiple choice — immediate feedback.

Discussion

Past discussion is visible to everyone. Only logged-in users can post comments and replies.

Starter discussion topics

  • Stream HTML benefit?
  • Fallback UX?

Sign up or log in to post comments and sync lesson progress across devices.

No discussion yet. Be the first to ask a question.

Jump