Prop Serialization Across the Boundary
You'll learn exactly what types of data you can and cannot pass from Server Components to Client Components.
The JSON Serialization Rule
When a Server Component passes props to a Client Component, those props must travel across the network from server to browser. This means they must be JSON-serializable—convertible to plain text and back again.
Think of it like packing a box for shipping: you can send letters, photos, and books, but you can't mail a living pet or a burning candle. Similarly, you can pass strings, numbers, arrays, and plain objects, but not functions, class instances, or Date objects.
What You CAN Pass
- Primitives: strings, numbers, booleans,
null,undefined - Plain objects:
{ name: "Alice", age: 30 } - Arrays:
[1, 2, 3]or["a", "b"] - Nested combinations:
{ users: [{ id: 1 }, { id: 2 }] }
What You CANNOT Pass
- Functions: no event handlers, callbacks, or methods
- Class instances:
new Date(), custom classes - Symbols, WeakMaps, or other non-serializable types
- React elements (directly—though Server Components as children works differently)
Why This Matters
The server runs your Server Component once, serializes the props, and sends them over the network. The browser receives this serialized data and hydrates your Client Component with it. Anything that can't survive this round-trip simply won't work.
If you need functions or complex objects in a Client Component, define them inside that Client Component instead of passing them from the server.
Key Takeaway: Props crossing from Server to Client Components must be JSON-serializable—think plain data only, no functions or class instances.