0
Challenge · 09Server vs Client Components
Serialization across the boundary
Modelused in ~70% of apps
The single most common crash a new Next.js developer hits in production: "Functions cannot be passed directly to Client Components." It happens because props don't travel as JavaScript objects — they're serialized, sent over the wire, and rebuilt. Once you know exactly what survives that trip, the whole error class disappears.
Core idea. Props handed from a Server Component to a Client Component aren't passed by reference — they're serialized on the server, streamed as data, and reconstructed in the browser. Plain objects and a handful of built-ins (Date, Map, Set, BigInt, Promise) survive; functions, class instances, and most Symbols do not. For callbacks, you don't pass a function — you pass a Server Action, which crosses as a reference.
poke it, drag it,
try to break it
try to break it
no slides here.
you drive.
you drive.
Playground, this isn't a screenshot
0
Idle1
Server render2
Stream chunks3
First paint4
JS arrives5
HydratedRequest the page
browser viewportblank
waiting for request…
server: renderToPipeableStream(<App/>)
stream: <html>… flushed in chunks →
stream: <Suspense> fallback first, then data
browser: paint HTML (fast FCP, no JS)
browser: download client bundle.js
hydrateRoot(el, <App/>) — attach handlers
JS attached: no
Try clicking Like before stage 5.
↑ play a little first, then dig in