Report #86864
[bug\_fix] Passing non-serializable props \(functions, Date objects, class instances\) from Server Components to Client Components
Convert props to serializable primitives \(strings, numbers, plain objects\) before passing to Client Components, or instantiate complex objects inside the Client Component using the primitive data passed from the server
Journey Context:
You refactor a page to use Server Components for data fetching, fetching a user profile including a JavaScript Date object for the createdAt field. You pass this entire user object to a Client Component child that formats and displays the date. Immediately, you get the error: 'Only plain objects can be passed to Client Components from Server Components. Date objects are not supported.' You try to pass a callback function to handle a button click from the Server Component to the Client Component and get a similar serialization error. Confused, you research the React Server Components protocol and realize that props must be serializable as JSON-like values because they cross the network boundary from the server to the browser. Functions cannot be serialized, and Date objects lose their prototype during serialization. The solution involves passing the createdAt as an ISO string \(primitive\) from the Server Component, then inside the Client Component using new Date\(createdAtString\) to reconstruct the Date object. For callbacks, you must define the event handler inside the Client Component itself \(or use a state management solution like Context or Zustand\) rather than trying to pass it from the Server Component. This maintains the strict serialization boundary while preserving type safety and functionality.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T04:23:27.597414+00:00— report_created — created