Serialization boundaries
What you need to know
Values crossing an RSC boundary must be representable by React’s supported serialization contract. This contract is broader than JSON, but it does not permit arbitrary server objects or ordinary function closures to become browser code.
By the end, you can: identify permitted data crossing; avoid secret props.
Build a deliberate serializable shape
function articleCard(row:{title:string;publishedAt:Date;internalNote:string}){ return {title:row.title, publishedAt:row.publishedAt.toISOString()};}console.log(articleCard({title:'Forest reading',publishedAt:new Date('2026-01-03T00:00:00Z'),internalNote:'private'}));Expected behavior: The returned object contains the title and ISO timestamp; the internal note is absent.
How it works
A safe beginner practice is to pass small plain DTOs of strings, booleans, numbers and arrays or objects containing allowed values. React’s documented RSC serialization also supports certain built-ins such as Date, Map and Set, promises, React elements and Server Functions under their respective rules. Ordinary custom class instances, objects with a null prototype, locally created symbols and arbitrary server callbacks are not supported. A globally registered symbol has a separate supported representation; this is not a reason to use symbols in a public DTO. Server Functions cross through special references, not by copying their private server implementation. A Date being serializable does not mean every timestamp is appropriate to expose. Separate type compatibility, runtime serialization and privacy review. For a public editorial preview, pass a title and ISO date string, not an ORM entity, a session object or a database connection. Explicitly decide which representation is needed and what locale/time zone controls formatting. The following example makes an ordinary ISO string so the boundary is easy to reason about and the displayed date does not depend on browser locale.
Consume a narrow boundary type
// ArticleCard.tsx'use client';export default function ArticleCard({title,publishedAt}:{title:string;publishedAt:string}){ return <article><h2>{title}</h2><time dateTime={publishedAt}> {publishedAt.slice(0,10)}</time></article>;}Expected behavior: The card shows the title and UTC calendar date (2026-01-03 for the preceding example). No locale-specific conversion is claimed.
Common mistake
Do not replace a failed serialization with JSON.stringify of an entire private object. That may hide the type issue while exposing its data or changing value semantics. Explicitly project fields and use the appropriate public representation.
Practice and verification
Classify a Date, a plain DTO, a database handle, an ordinary server closure and a Server Function reference. Explain why serializable and safe to disclose are different properties. Inspect the built app payload once dependencies are approved.
Scope: App Router, proposed Next.js 16.x and React 19, Cache Components disabled. Framework snippets are staged, not executed; local policy, SQLite and HTTP transport evidence is separate. Exact patched dependencies and platform contracts are pending.
Further reading: React Client · Components · Security Data