RSC and HTML delivery
What you need to know
On an initial App Router visit, Next.js can deliver HTML together with the React Server Component payload and the JavaScript needed by Client Components. HTML provides the initial visible document; the RSC payload represents the server-rendered component tree and references client boundaries; hydration attaches interactive client behavior. Subsequent client navigations may reuse layouts and request or reuse RSC data instead of loading a new document.
By the end, you can: distinguish RSC payload and initial HTML; describe hydration boundary.
Server page and interactive boundary (two separate files)
// app/reading/page.tsximport ReadingToggle from "./ReadingToggle";export default function Reading() { return <main><h1>Reading list</h1><ReadingToggle /></main>;}// ReadingToggle is defined in its own file.Expected behavior (not framework-tested): Initial output includes a heading and the toggle UI. The heading does not need its own client-side component module.
How it works
Client Component is a module boundary, not a promise that code only executes in a browser. Initial HTML can include that component. Hydration reconciles the initial markup and makes its client behavior available. On navigation the browser may already have the required JS and some cached route data. A Server Component does not hydrate as a client module. Inspect HTML, the network trace, console and real interaction separately; seeing text in page source cannot prove that the control responds. Data passed over a boundary is browser-visible even if it is not shown in HTML.
app/reading/ReadingToggle.tsx
"use client";import { useState } from "react";export default function ReadingToggle() { const [saved, setSaved] = useState(false); return <button type="button" aria-pressed={saved} onClick={() => setSaved(s => !s)}>{saved ? "Saved" : "Save for later"}</button>;}Expected behavior (not framework-tested): Initially the button says Save for later. After hydration, clicking changes it to Saved; clicking again restores the initial label. It is local state, not persistent account data.
Common mistake
Avoid reading localStorage, window or a changing timestamp in an unguarded initial render. Server and initial client markup can disagree. Use stable initial data and perform browser-only work in an appropriate client lifecycle. Do not treat hydration warnings as harmless by default.
Practice and verification
Compare direct load with a Link navigation to /reading. Record initial heading and button, JS availability, first click, second click, and hydration console warnings. Disable JS in a separate test: verify visible initial HTML without claiming the toggle still works.
Scope: App Router, proposed Next.js 16.x, Cache Components disabled for these labs. Snippets assume a reviewed TypeScript app and are static examples; framework behavior has not been executed. Exact supported patch and dependency set must be verified before running.
Further reading: Components · Fetching