React Server Components 14 🧬 The RSC Payload — How the server tree is serialized for the browser
The RSC Payload is not HTML and it is not a JSON object. It is a serialized description of the React tree that the server produces, and it carries two things that HTML cannot: references to Client Components that the browser must load and execute, and serialized props that the browser needs to render them . When the browser receives the payload, React reconciles it against the existing DOM, loads the client modules it references, and hydrates only the parts that need interactivity. The Server Component code never reaches the browser; only the output of the Server Component render does.
This chapter covers the payload’s structure, the encoding scheme that handles values JSON cannot represent, the client module reference that replaces an imported Client Component, and the delivery model that ships the payload alongside the initial HTML.
Key point: The RSC Payload is a serialized React element tree, not a JSON document. It uses a line-based format where each line is a chunk, and the chunks reference each other by ID. Client Components are not rendered into the payload; they are represented by an import reference that the browser resolves.
Why the payload is not JSON
The element problem. A React element is not a JSON value. It has a $$typeof symbol, a type that can be a string or a function reference, a key, and a props object. JSON cannot represent symbols, and it cannot represent a reference to a module. The RSC format encodes elements as arrays with a "$" marker in the first position to represent the REACT_ELEMENT_TYPE .
["$", "div", null, { "className": "app", "children": [...] }]
The first element is the element marker. The second is the type ("div" for a host element, or an import reference for a Client Component). The third is the key. The fourth is the props object .
The value problem. JSON cannot represent undefined, NaN, Infinity, -0, Date, BigInt, Map, Set, or TypedArray. The RSC format encodes these with a $ prefix followed by a letter that identifies the type. $undefined for undefined, $NaN for NaN, $D followed by an ISO string for a Date, $n followed by digits for a BigInt, and $S followed by the name for a global symbol . A string that starts with $ is escaped by doubling the $, so the literal string $100 becomes $$100 on the wire .
The binary problem. A TypedArray is not encoded as JSON at all. It is written as a binary chunk with the format <chunk id>:<tag><length in hex>,<raw binary data>. The tag identifies the array type: o for Uint8Array, g for Float64Array, A for ArrayBuffer, and so on .
a. The line-based chunk format
The payload is a sequence of lines. Each line has an optional chunk ID, a tag, and a value. The chunk ID is a hexadecimal number. The tag is a single character that identifies the kind of chunk.
0:["$","div",null,{"children":"Hello"}]
1:I["components/counter","Counter"]
2:["$","$L1",null,{}]
The first line is the root element. The second line is an import chunk (I) that maps the ID 1 to the client module "components/counter" and the export name "Counter". The third line is an element whose type is "$L1", which is a reference to the import chunk with ID 1 .
The import chunk is how a Client Component is represented. The server does not execute the Client Component function. It emits a reference that the browser resolves by loading the module from the client bundle and finding the named export. The $L prefix is the marker for an import reference .
b. The serialization of a Server Component tree
A Server Component is executed on the server, and its return value is serialized. The function itself never appears in the payload. The payload contains the JSX that the function returned, with the nested elements encoded as arrays and the props encoded with the type markers .
A Server Component that returns a div with a p child produces a payload that is a single element chunk with a children array containing the child element. The nested structure is preserved because the children prop contains the child element arrays.
The payload is streamed as the server renders. A suspended component produces a fallback chunk first, and the resolved content is appended when the Promise resolves. The client reads the stream incrementally, which is what makes streaming work.
c. The delivery alongside the HTML
On the initial load, the RSC Payload is embedded in the HTML response. The framework injects the payload as a series of <script> elements that the client reads to reconstruct the tree . The browser parses the HTML, paints the shell, and then the React client runtime reads the embedded payload to hydrate the Client Components and attach the event handlers.
On a client-side navigation, the browser does not receive HTML. It receives only the RSC Payload from the server, and React reconciles it against the existing DOM. The Server Component code runs on the server, the payload is sent, and the client updates the tree without a full page reload .
The payload is not cached like a static HTML page. It is a description of a specific render, and it depends on the data that the Server Components fetched during that render. A new render produces a new payload.
Complete Example Session
// ============================================
// PART 1: THE SERVER COMPONENT
// ============================================
// app/page.tsx
async function Page() {
const post = await getPost()
return (
<article>
<h1>{post.title}</h1>
<LikeButton postId={post.id} />
</article>
)
}
// ============================================
// PART 2: THE PAYLOAD (SIMPLIFIED)
// ============================================
0:["$","article",null,{"children":[
["$","h1",null,{"children":"Hello"}],
["$","$L1",null,{"postId":"1"}]
]}]
1:I["components/like-button","LikeButton"]
// ============================================
// PART 3: THE CLIENT COMPONENT REFERENCE
// ============================================
// LikeButton is not rendered on the server.
// It is represented by the import chunk.
// The browser loads the module and finds the export.
// ============================================
// PART 4: THE SERIALIZED PROPS
// ============================================
// postId is a string, so it is serialized directly.
// A Date prop would be encoded as $D2026-11-07T...
// A Map prop would be outlined to its own chunk.
// ============================================
// PART 5: THE IMPORT CHUNK
// ============================================
1:I["components/like-button","LikeButton"]
// ID: 1
// Tag: I (import)
// Module: components/like-button
// Export: LikeButton
// ============================================
// PART 6: THE ELEMENT REFERENCE
// ============================================
["$","$L1",null,{"postId":"1"}]
// "$L1" is a reference to the import chunk with ID 1.
// ============================================
// PART 7: THE TYPE ENCODING
// ============================================
// undefined → $undefined
// NaN → $NaN
// Date → $D2026-11-07T10:00:00.000Z
// BigInt → $n123456789
// Symbol.for → $Sname
// ============================================
// PART 8: THE BINARY CHUNK
// ============================================
// 3:o5,Hello
// ID: 3
// Tag: o (Uint8Array)
// Length: 5 bytes
// Data: Hello
// ============================================
// PART 9: THE EMBEDDED PAYLOAD
// ============================================
// The initial HTML contains the payload
// as a series of <script> elements.
// The client reads them to hydrate.
// ============================================
// PART 10: THE NAVIGATION PAYLOAD
// ============================================
// On a client navigation, only the RSC Payload is sent.
// No HTML. React reconciles against the existing DOM.
The ten parts covered the Server Component, the simplified payload, the Client Component reference, the serialized props, the import chunk, the element reference, the type encoding, the binary chunk, the embedded payload, and the navigation payload.
Quick Reference
Payload tags
| Tag | Meaning |
|---|---|
$ | React element |
I | Import chunk (client module reference) |
$L | Element type reference to an import chunk |
$D | Date |
$n | BigInt |
$S | Global symbol |
$undefined | Undefined |
$NaN | NaN |
Element array format
| Position | Value |
|---|---|
| 0 | "$" (element marker) |
| 1 | Type (string or $L reference) |
| 2 | Key or null |
| 3 | Props object |
Binary chunk format
| Part | Meaning |
|---|---|
id: | Chunk ID in hex |
tag | Array type (o, g, A, etc.) |
length, | Byte length in hex |
data | Raw binary |
Serializable values
| Value | Encoding |
|---|---|
Date | $D + ISO string |
Map | Outlined chunk, $Q reference |
Set | Outlined chunk, $W reference |
TypedArray | Binary chunk |
String starting with $ | Doubled $ |
Best Practices
✅ Do This:
// Pass serializable props to Client Components
<LikeButton postId={post.id} /> // ✅
// Convert class instances to plain objects
{ url: myUrl.toString() } // ✅
// Use Server Actions for callable behavior
onAction={handleClick} // 'use server' function // ✅
❌ Don’t Do This:
// Pass a plain function from server to client
<Button onClick={() => {}} /> // ❌
// Pass a class instance
<Client date={new Date()} /> // ❌ (if not serializable)
// Assume the payload is JSON
// It is a line-based format with type markers // ❌
Common Pitfalls
| Pitfall | Why It Happens | Fix |
|---|---|---|
| Payload is not valid JSON | Line-based format with tags | Parse with the RSC client, not JSON.parse |
| Props are missing on the client | Non-serializable value | Convert to plain object or Server Action |
| Import chunk is not resolved | Client module not in the bundle | Check the "use client" directive |
| Binary data is corrupted | Incorrect chunk length | Verify the hex length matches the data |
| Date is a string on the client | Serialized as $D + ISO | Parse with new Date() on the client |
Real-World Examples
1. Element chunk
0:["$","div",null,{"children":"Hello"}]
2. Import chunk
1:I["components/counter","Counter"]
3. Element with import reference
2:["$","$L1",null,{}]
4. Date encoding
$D2026-11-07T10:00:00.000Z
5. BigInt encoding
$n123456789
6. Symbol encoding
$Smy.symbol
7. String escaping
$$100 dollars // literal $100 dollars
8. Binary chunk
3:o5,Hello
9. Embedded payload
<script>self.__next_f.push([1, "0:..."])</script>
10. Navigation payload
Only the RSC Payload, no HTML.
Visual
The payload structure
┌─────────────────────────────────────────────────────────────┐
│ RSC PAYLOAD (line-based) │
│ │
│ 0:["$","article",null,{"children":[...]}] │
│ 1:I["components/like-button","LikeButton"] │
│ 2:["$","$L1",null,{"postId":"1"}] │
│ │
│ Each line is a chunk. │
│ Chunks reference each other by ID. │
└─────────────────────────────────────────────────────────────┘
The Client Component reference
┌─────────────────────────────────────────────────────────────┐
│ SERVER │
│ <LikeButton postId="1" /> │
│ │ │
│ ▼ │
│ Payload: ["$","$L1",null,{"postId":"1"}] │
│ + 1:I["components/like-button","LikeButton"] │
│ │
│ CLIENT │
│ Loads the module, finds the export, renders. │
└─────────────────────────────────────────────────────────────┘
The type encoding
┌─────────────────────────────────────────────────────────────┐
│ JSON cannot represent: │
│ undefined → $undefined │
│ NaN → $NaN │
│ Date → $D2026-11-07T... │
│ BigInt → $n123... │
│ Map → $Q<chunk id> │
└─────────────────────────────────────────────────────────────┘
The delivery
┌─────────────────────────────────────────────────────────────┐
│ INITIAL LOAD │
│ HTML + embedded RSC Payload │
│ Browser paints, then hydrates │
│ │
│ NAVIGATION │
│ RSC Payload only │
│ React reconciles against the DOM │
└─────────────────────────────────────────────────────────────┘
Summary
| Item | Value |
|---|---|
| Payload type | Line-based serialized React tree |
| Element marker | "$" in the first array position |
| Client Component reference | Import chunk (I) + $L reference |
| Date encoding | $D + ISO string |
| Map/Set | Outlined chunks with $Q/$W references |
| Binary data | Binary chunks with type tags |
| Initial load | Payload embedded in HTML |
| Navigation | Payload only, no HTML |
Key takeaways:
- The RSC Payload is a serialized React element tree, not JSON. Elements are encoded as arrays with a
"$"marker, and values that JSON cannot represent are encoded with$prefixes and type letters . - Client Components are represented by import references, not rendered output. The payload contains an import chunk that maps an ID to a client module and export name, and an element reference that points to that chunk. The browser resolves the reference and executes the Client Component .
- The payload is streamed as the server renders. A suspended component produces a fallback chunk, and the resolved content is appended when the Promise resolves. The client reads the stream incrementally, which is what makes streaming work.
- On the initial load, the payload is embedded in the HTML. The browser paints the shell and then reads the embedded payload to hydrate the Client Components. On a navigation, only the payload is sent, and React reconciles it against the existing DOM .
- Only serializable values can cross the boundary. Plain objects, arrays, primitives, Dates, Maps, Sets, and Server Actions are serializable. Plain functions, class instances, and local symbols are not .
- The payload is not cached like HTML. It is a description of a specific render that depends on the data the Server Components fetched. A new render produces a new payload.
Remember: The RSC Payload is the bridge between the server render and the client runtime. It carries the serialized element tree, the references to the Client Components that the browser must load, and the serialized props that those components need. It uses a line-based chunk format with type markers for values that JSON cannot represent. It is embedded in the initial HTML and sent alone on navigation. The Server Component code never appears in the payload; only the output of its render does.
Stop using slow, ad-bloated tool sites! 🤮
🔎 Search “KandZ Tools” on Google to use many professional utilities for free.
KandZ.me is the ultimate minimalist hub for:
✅ Finance (Mortgage, Interest, Inflation)
✅ Tech (Base64, JSON, Dev Suite, IP)
✅ Health (BMI, BMR, TDEE)
✅ Productivity (Timer, Workspace, QR)
⚡️ Fast & Private
🔒 No data leaves your device
💎 100% Free
🔗 Use it now: https://tools.kandz.me
🔖 Bookmark it—you’ll need it later!