Skip to main content
XenonStack

Cloud Native Applications

XenonStack Blog React Server Components: How They Work in React 19

and | Published | Updated

Key takeaway

  • How React Server Components work in React 19: Server vs Client Components, Server Functions, react-dom/server SSR and CVE-2025-55182 fixed versions.

React Server Components are components that render ahead of time on the server, either once at build time or on each request, and never ship their code to the browser. They can read databases, files and internal services directly, then pass the result as props to small interactive Client Components. In React 19 they are stable, and frameworks such as the Next.js App Router use them by default for layouts and pages. If your team is still building React skills, start with our React learning path and come back to this guide for the server side.

This guide explains how Server Components work, how they differ from classic server-side rendering with react-dom/server, what Server Functions add, and what has changed since the 2020 research preview. It also covers the security work that now comes with them: CVE-2025-55182, a critical remote code execution flaw disclosed in December 2025, showed that adopting Server Components moves part of the front end into the server attack surface.

What are React Server Components?

The React documentation defines Server Components as "a new type of Component that renders ahead of time, before bundling, in an environment separate from your client app or SSR server". Because they are not sent to the browser, they cannot use interactive APIs such as useState or event handlers. They can be async, so a component can await a database query inside render, and React suspends and streams the result with Suspense.

Interactivity comes from Client Components, which are ordinary React components in a file that starts with the "use client" directive. That directive marks the module and everything it imports as client code, creating a boundary in the module dependency tree. There is no directive for Server Components: in an app that supports them, components are server components unless they sit behind a "use client" boundary. Props crossing that boundary must be serialisable, so plain objects, strings, numbers, dates and promises can cross, while class instances and ordinary functions cannot.

Component typeWhere it runsWhat it can doWhat it cannot do
Server ComponentBuild server or web server, never the browserAwait data in render, read files and databases, use secrets, keep heavy libraries out of the bundleuseState, effects, event handlers, browser APIs
Client Component ("use client")Prerendered to HTML on the server, then hydrated in the browserState, effects, event handlers, browser APIs, custom hooksRead server-only resources directly
Server Function ("use server")Server, called from the client over the networkMutations and form handling with validated, authorised inputReturn non-serialisable values such as class instances

How do React Server Components work, step by step?

Server Components can run in two places. They can run once at build time on a CI server, for content that changes rarely, with the output uploaded to a CDN. Or they can run on a web server for each request, which lets them read live data and be re-fetched to render again. In both cases the browser never receives the original component code or the libraries it imported.

Two-column diagram. Server side: Server Components, RSC Payload, HTML prerender with react-dom/server, Server Functions. Browser side: fast HTML preview, reconcile, hydrate, cached later navigations.

The Next.js documentation describes the request flow in its App Router, which is the most common production implementation:

  1. On the server, Server Components render into the React Server Component Payload (RSC Payload): a compact, serialised tree holding the rendered output, placeholders for Client Components with references to their JavaScript files, and the props passed to them.
  2. Client Components and the RSC Payload are used to prerender HTML, so the user sees a fast, non-interactive preview.
  3. In the browser, React uses the RSC Payload to reconcile the server and client trees.
  4. JavaScript hydrates the Client Components, attaching event handlers so the page becomes interactive.
  5. On later navigations, the RSC Payload is prefetched and cached, and Client Components render entirely on the client.

A minimal example, in the style of the Next.js documentation, shows the split. The page is an async Server Component that reads data; the like button is the only code shipped for interactivity.

// app/[id]/page.js  (Server Component by default)
import LikeButton from '@/app/ui/like-button'
import { getPost } from '@/lib/data'

export default async function Page({ params }) {
  const { id } = await params
  const post = await getPost(id)   // runs on the server only
  return <LikeButton likes={post.likes} />
}

// app/ui/like-button.js
'use client'
import { useState } from 'react'

export default function LikeButton({ likes }) {
  const [count, setCount] = useState(likes)
  return <button onClick={() => setCount(count + 1)}>{count} likes</button>
}

The practical rule is to put "use client" on the smallest interactive leaves, such as a search box inside a mostly static layout, rather than on large parts of the tree, because everything a client module imports joins the client bundle. Server Components can still be passed to a Client Component as children, so server-rendered content can sit inside a client-side modal or tab without being bundled.

How do Server Components differ from SSR with react-dom/server?

The react-dom/server package is how React does classic server-side rendering (SSR): it renders a component tree to HTML for the first page load. Its current APIs are renderToPipeableStream for Node.js streams, renderToReadableStream for Web Streams environments such as Deno and edge runtimes, resume and resumeToPipeableStream for continuing a prerender, and the legacy renderToString and renderToStaticMarkup for environments without streams. The react-dom/static package adds prerender and prerenderToNodeStream for static generation.

SSR on its own does not remove code from the browser. Every component rendered to HTML is still downloaded and hydrated. Server Components change that, because their code stays on the server and only their output travels. The two work together: a framework renders Server Components to the RSC Payload, then uses react-dom/server to turn that payload and the Client Components into streamed HTML.

ApproachWhat reaches the browserWhen it fitsMain cost
Client-side renderingA small HTML shell plus the full JavaScript bundleHighly interactive apps behind a login where search indexing does not matterSlower first paint and larger bundles; data fetched after load, often in effects
SSR with react-dom/serverHTML for the first load plus JavaScript for every componentPublic pages that need fast first paint and indexable HTMLAll components still hydrate, so bundle size is unchanged
Static prerender (react-dom/static)Prebuilt HTML plus JavaScriptContent that changes rarelyRebuilds or revalidation needed when data changes
React Server Components with SSRHTML, the RSC Payload and JavaScript for Client Components onlyData-heavy pages with a few interactive parts, such as portals, dashboards and cataloguesNeeds a supporting framework or bundler, a server runtime and server-side patching

What are Server Functions, and how do they relate to Server Actions?

Server Functions let Client Components call async functions that run on the server. You mark them with the "use server" directive, either inside a Server Component or at the top of a module that Client Components import. The framework creates a reference to the function and passes it to the client; when the client calls it, React sends a request to the server, runs the function and returns the result.

Until September 2024 React called all of these Server Actions. The current terminology is that a Server Function passed to a form action prop, or called from inside an action, is a Server Action, but not every Server Function is one. With a form action, React passes the submitted FormData as the first argument, resets uncontrolled fields after success, and lets users submit before the JavaScript bundle loads. useActionState adds pending and error state around the call.

// actions.js
'use server'
export async function createNote(formData) {
  const title = formData.get('title')
  if (!title) return { error: 'Title is required' }
  // check the signed-in user may do this, then write to the database
}

Every Server Function is a public HTTP endpoint in practice. The React documentation states that its arguments "are fully client-controlled" and must be treated as untrusted input, and that each function must check the logged-in user is allowed to perform the action.

What has changed since the 2020 research preview?

This post first covered Server Components when the React team announced them on 21 December 2020 as research and development, with a talk, an RFC and a demo app. Much of what early articles described no longer applies:

Then (2020 preview)Now (React 19.x, November 2026)
Research preview on experimental 0.0.0-experimental package buildsStable in React 19, released December 2024; current release 19.3, released 9 September 2026
Components named with .server.js and .client.js file suffixes in the demoComponents are server components by default; "use client" marks the client boundary and "use server" marks Server Functions
Demo app run on Node.js 14 with a local Postgres databaseAdopted through frameworks and bundlers: Next.js App Router, React Router, Waku, Parcel and the Vite RSC plugin
"Server Actions" as the name for server-called functions"Server Functions" since September 2024; Server Actions are the subset used with actions and forms
Security not discussedCVE-2025-55182 (CVSS 10.0) and four follow-up advisories; patched package versions required

One caution for platform teams: React states that the APIs bundlers and frameworks use to implement Server Components do not follow semver and may break between React 19.x minor releases. Application code is protected by the stable API, but anyone building or maintaining a custom bundler integration should pin a specific React version.

What security and governance issues should leaders plan for?

On 3 December 2025 the React team disclosed CVE-2025-55182, rated CVSS 10.0, reported on 29 November 2025 through the Meta Bug Bounty. An unauthenticated attacker could send a crafted HTTP request to any Server Function endpoint and, when React deserialised it, achieve remote code execution on the server. The vulnerable packages were react-server-dom-webpack, react-server-dom-parcel and react-server-dom-turbopack, and affected frameworks included next, react-router, waku, @parcel/rsc, @vitejs/plugin-rsc and rwsdk. An app could be exposed even without defining any Server Function, as long as it supported Server Components.

AdvisoryImpactAffected react-server-dom-* versionsFixed versions
CVE-2025-55182 (3 Dec 2025)Remote code execution, critical (CVSS 10.0)19.0, 19.1.0, 19.1.1, 19.2.019.0.1, 19.1.2, 19.2.1
CVE-2025-55184 and CVE-2025-67779 (11 Dec 2025)Denial of service, high (CVSS 7.5)19.0.0 to 19.0.3, 19.1.0 to 19.1.3, 19.2.0 to 19.2.319.0.4, 19.1.5, 19.2.4
CVE-2025-55183 (11 Dec 2025)Source code of Server Functions exposed, medium (CVSS 5.3)As above19.0.4, 19.1.5, 19.2.4
CVE-2026-23864 (26 Jan 2026)Denial of service, high (CVSS 7.5); the earlier fix was incompleteAs above19.0.4, 19.1.5, 19.2.4

The React team warns that hosting-provider mitigations are temporary and do not replace upgrading, and that teams on the intermediate 19.0.3, 19.1.4 or 19.2.3 releases must update again. Framework users should follow their framework's own upgrade notes, for example the Next.js security update, rather than upgrading React packages alone.

Beyond patching, four controls matter. Validate and authorise inside every Server Function. Keep secrets out of shared modules by importing the server-only package, which turns an accidental client import into a build error. Do not hard-code secrets in Server Function source, since CVE-2025-55183 exposed source but not runtime environment variables. And give front-end dependencies the same vulnerability ownership, scanning and patch deadlines as back-end services, because with Server Components the front-end repository now runs on the server. Teams that want this patch-and-respond loop to run with less manual effort can look at AgentSRE, agentic AI for incident management and observability built for enterprises that cannot afford downtime.

How should an enterprise adopt React Server Components?

  1. Confirm the platform. Use a framework with Server Components support, such as the Next.js App Router, rather than wiring a bundler yourself, and record the exact React and framework versions in use.
  2. Patch first. Check that lock files resolve react-server-dom-* to 19.0.4, 19.1.5, 19.2.4 or later in the same line, and that the framework is on its fixed release.
  3. Pick one data-heavy route. Move a read-mostly page, such as a report or catalogue view, to async Server Components and keep its interactive widgets as small Client Components.
  4. Measure. Compare client JavaScript size, first contentful paint and server cost before and after on that route.
  5. Add Server Functions with rules. Introduce mutations only with input validation, an authorisation check in every function and the server-only guard on shared modules.
  6. Operate it like a service. Add the front-end server to dependency scanning, logging and incident response, then extend route by route.

XenonStack engineering teams already run server-rendered Next.js applications on managed cloud hosting, and the pattern above reflects how that work is sequenced: one route, measured, then extended. Where the same front end also surfaces AI agents, ElixirClaw puts AI agents to work across enterprise systems within the rules, sign-off thresholds and audit records leadership already relies on, and Server Functions are a natural place to call those governed workflows from the UI. For delivery support, see our React.js application development services, and for front-end performance work generally, our guide to optimising React application performance.

When should you not use React Server Components?

Server Components are not the right default everywhere. Skip or delay them when:

  • The app is a highly interactive tool, such as an editor or a canvas, where almost every component needs state and event handlers, so little code would move to the server.
  • The front end is deployed as static files to a CDN with no server runtime, and build-time rendering does not cover the data needs.
  • The team cannot commit to patching front-end server packages quickly, because Server Function endpoints are reachable by anyone on the network.
  • The app depends on many third-party libraries that use client-only features without "use client" entry points, which means wrapping each one.
  • A custom bundler integration would have to track React internals that can change between minor releases.

In those cases, client-side rendering or classic SSR with react-dom/server remains a sound choice. Structure, testing and performance practices still apply; see our guides to React project structure and unit testing in React, and for the framework most teams use with Server Components, Next.js key features.

To map one front-end decision your agents should make, and the context and policy it depends on, book a Context Workshop. See what happens in the workshop.

Frequently asked questions about React Server Components

Are React Server Components stable?

Yes. React Server Components and Server Functions are stable in React 19 and will not break between minor versions. The lower-level APIs that bundlers and frameworks use to implement them do not follow semver, so framework authors pin a specific React version.

Do React Server Components replace server-side rendering?

No. Server-side rendering with react-dom/server turns a component tree into HTML for the first load, and the components still hydrate in the browser. Server Components never ship to the browser at all. Frameworks such as the Next.js App Router use both: Server Components produce the RSC Payload, which is then used to prerender HTML.

What is the difference between Server Functions and Server Actions?

Server Function is the umbrella term, used since September 2024, for an async function marked with "use server" that Client Components can call on the server. A Server Function passed to a form action prop, or called from inside an action, is a Server Action.

Which React versions fix CVE-2025-55182?

The first fixes were react-server-dom-webpack, react-server-dom-parcel and react-server-dom-turbopack 19.0.1, 19.1.2 and 19.2.1. Later denial-of-service and source-code-exposure advisories mean the versions React now lists as safe are 19.0.4, 19.1.5 and 19.2.4.

Is my React app affected by CVE-2025-55182 if it does not use Server Components?

According to the React team, an app whose React code does not use a server, or that does not use a framework, bundler or bundler plugin supporting React Server Components, is not affected. An app that supports Server Components can be vulnerable even if it defines no Server Function endpoints.

Follow XenonStack on LinkedIn: XenonStack on LinkedIn for new guides on agentic AI, data and platform engineering.

Table of Contents

navdeep-singh-gill

Navdeep Singh Gill

Global CEO and Founder of XenonStack

LinkedIn profile

Navdeep Singh Gill is serving as Chief Executive Officer and Product Architect at XenonStack. He holds expertise in building SaaS Platform for Decentralised Big Data management and Governance, AI Marketplace for Operationalising and Scaling. His incredible experience in AI Technologies and Big Data Engineering thrills him to write about different use cases and its approach to solutions.

Get the latest articles in your inbox

Subscribe Now

Interested in solving your challenges with the XenonStack team?
Get Started

Tell us about you and your priorities so we can prepare the right conversation. It takes about 2 minutes.

Please Select your Industry
Banking
Fintech
Payment Providers
Wealth Management
Discrete Manufacturing
Semiconductor
Machinery Manufacturing / Automation
Appliances / Electrical / Electronics
Elevator Manufacturing
Defense & Space Manufacturing
Computers & Electronics / Industrial Machinery
Motor Vehicle Manufacturing
Food and Beverages
Distillery & Wines
Beverages
Shipping
Logistics
Mobility (EV / Public Transport)
Energy & Utilities
Hospitality
Digital Gaming Platforms
SportsTech with AI
Public Safety - Explosives
Public Safety - Firefighting
Public Safety - Surveillance
Public Safety - Others
Media Platforms
City Operations
Airlines & Aviation
Defense Warfare & Drones
Robotics Engineering
Drones Manufacturing
AI Labs for Colleges
AI MSP / Quantum / AGI Institutes
Retail Apparel and Fashion

Continue