0

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.
Playground, this isn't a screenshot
0
Idle
1
Server render
2
Stream chunks
3
First paint
4
JS arrives
5
Hydrated

Request 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