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

The RSC Wire Format: Not HTML, Not JSON

Server Components serialize to a special streaming format that encodes React elements, not raw HTML strings.

The RSC Wire Format: Not HTML, Not JSON

You'll learn: Server Components don't serialize to HTML or JSON—they use a special streaming format that preserves React's component structure.

Not What You'd Expect

When Server Components render, you might assume they produce either:

  • HTML strings (like traditional SSR), or
  • JSON data (like an API response)

Neither is correct. React invented a custom wire format specifically for Server Components that streams a representation of the React element tree itself—complete with component boundaries, props, and lazy references to Client Components.

Why HTML Won't Work

HTML is a finished output format. Once rendered to HTML, you lose the React structure—no component boundaries, no ability to hydrate interactive pieces selectively. HTML can't say "insert Client Component here" or "this part suspended."

Why Plain JSON Won't Work Either

JSON can't represent functions, Promises, or component references. It also can't stream efficiently—you'd need the entire tree before parsing. The RSC format streams line-by-line as components resolve, unblocking the browser faster.

What the Wire Format Actually Contains

The format encodes:

  • React elements with their type and props
  • References to Client Component modules (by ID)
  • Serialized data (strings, numbers, arrays)
  • Suspense boundaries and their states
  • Streamed chunks as async components resolve

It looks like text, but it's structured for React's reconciler to reconstruct the component tree on the client, then selectively hydrate only the Client Components.

Key Takeaway: The RSC wire format is a streaming, React-specific protocol that preserves component structure—not HTML markup or plain JSON data.