Course contentsShow
← React
Lesson 1540 of 2,39638. Server Components FundamentalsFree lesson

The Serialization Boundary

Props crossing the boundary must be JSON-serializable: no functions, classes, or Dates without transformation.

The Serialization Boundary

You'll learn why props passed between Server and Client Components must be JSON-serializable and what that restriction means in practice.

The Data Crossing Problem

When a Server Component renders and passes props to a Client Component, those props need to travel from the server to the browser. React doesn't teleport JavaScript values — it sends data over the network. That data must survive the journey.

Think of it like sending a package through the mail. You can send a photograph, a letter, or a book. But you can't send "the act of running" or "the feeling of warmth." Similarly, you can send strings, numbers, arrays, and plain objects. But you cannot send functions, class instances, or Date objects without converting them first.

What's Allowed, What's Not

Serializable (works):

  • Strings, numbers, booleans
  • Plain objects and arrays
  • null and undefined

Not serializable (breaks):

  • Functions (including event handlers)
  • Class instances
  • Date objects (unless converted to ISO strings)
  • Map, Set, Symbol
  • DOM nodes

When you cross the boundary from Server Component to Client Component, React serializes the props into the RSC wire format. If you pass a function, React can't encode it — functions are code, not data.

The Transformation Solution

For Date objects, convert them: createdAt={post.createdAt.toISOString()}. The Client Component receives a string and can reconstruct the date if needed.

For functions, define them in the Client Component itself — they belong there anyway since only Client Components handle interactivity.

Key Takeaway: Props crossing from Server to Client Components must be JSON-serializable — plain data only, no functions, classes, or unconverted Dates. The serialization boundary enforces a clean data contract between server and browser.