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

Props Must Be Serializable

Data passed to Server Components must serialize across the network boundary: no functions, no class instances.

Props Must Be Serializable

What you'll learn: Why Server Components can only receive props that survive the journey across the network.

Server Components run on the server and send their output to the client. But what happens when a parent component (maybe another Server Component, maybe a Client Component from the server's perspective) passes props down? Those props need to travel through the network boundary—and not everything in JavaScript can make that trip.

The Network Boundary Rule

When you pass props to a Server Component, React must serialize them—convert them to a format that can be transmitted over the network and reconstructed on the other side. This is similar to JSON.stringify(): only plain data survives.

What works:

  • Strings, numbers, booleans
  • Plain objects and arrays
  • Dates (serialized as strings)
  • React elements (special case, handled by RSC format)

What doesn't work:

  • Functions (including event handlers)
  • Class instances (like new CustomClass())
  • Symbols
  • undefined as a value (objects with undefined fields are okay)

Why This Matters

Think of the network like a postal service. You can mail a letter (string), a photo (data), or even instructions written on paper (React elements). But you can't mail a living person (function) or your actual coffee mug (class instance)—you could mail a description of the mug, but not the object itself.

This is why Server Components can't have event handlers passed as props. Event handlers are functions, and functions contain closures, scope references, and executable code that simply can't serialize.

Key Takeaway: Server Component props must be serializable—stick to plain data types, and remember that functions and class instances can't cross the network boundary.