React Server Components

Also known as: RSC

On this page 7

React Server Components (RSC) are React components that execute only on the server and send a serialized description of their output to the browser instead of their JavaScript code. In modern web applications, they let a single component tree mix server-only logic, such as database queries and secret-bearing API calls, with interactive client components, while reducing the JavaScript bundle that users must download.

The model was introduced by the React team as a research proposal in 2020 and became stable with React 19, with Next.js App Router as its most widely used implementation. RSC is not a replacement for server-side rendering (SSR); it is a new component type that works alongside SSR, hydration and client-side rendering.

How React Server Components render and stream

React Server Components render in a server environment that has access to files, databases and internal services, and the result travels to the client as the RSC payload, a compact streaming format sometimes called the Flight protocol. The payload describes the rendered element tree, the props passed to client components and references to client modules, not the server code itself.

On the client, React reads the payload and reconciles it into the existing tree. Because the format streams, the server can send finished parts of the page first and fill Suspense boundaries later as slower data arrives. A navigation can request a new payload and merge it without losing client state such as form input or scroll position.

The following table lists the main stages of a request in a typical RSC framework.

StageWhere it runsWhat happens
Server component renderServerFetches data and produces the RSC payload
SSR of the payloadServerOptionally turns the payload into initial HTML
StreamingNetworkHTML and payload chunks arrive progressively
HydrationBrowserOnly client components become interactive
Client navigationBrowser and serverNew payload is fetched and merged into the tree
Request lifecycle in an RSC application

Server components, client components and the use client boundary

In an RSC application every component is a server component by default, and a file that begins with the "use client" directive marks a client boundary. Everything imported below that boundary is bundled for the browser and can use state, effects and event handlers. Server components can render client components and pass them serializable props, but client components cannot import server components directly; they can only receive them as children or other props.

The table below compares the two component types on the capabilities that matter most in design decisions.

CapabilityServer componentClient component
Async rendering with awaitYesNo, uses hooks or libraries instead
Direct database or file accessYesNo
useState and useEffectNoYes
Event handlers such as onClickNoYes
Code sent to the browserNoneFull component code
Access to secrets and tokensSafe on the serverNever safe
Capabilities of server and client components

Server Actions, also called server functions and marked with "use server", complete the model in the other direction. They let a client component call a server function by reference, which React transmits as an RPC-style request; this replaces many hand-written API endpoints for form submissions and mutations.

How RSC differs from SSR, SSG and client-side rendering

React Server Components are often confused with server-side rendering, but the two solve different problems. SSR produces HTML for the first paint and then ships and hydrates the whole component tree, while RSC decides which components ever reach the browser at all. Most frameworks combine them: server components render the payload, and SSR converts that payload to HTML for the initial request.

The table summarizes how RSC relates to neighboring rendering strategies in the same Topic.

ApproachOutputJavaScript shippedTypical strength
Client-side renderingEmpty shell, then DOM in browserWhole applicationRich interactivity after load
SSR with hydrationHTML per requestWhole component treeFast first paint, dynamic data
SSGHTML at build timeWhole component treeCheap hosting, cacheable pages
Islands architectureStatic HTML with isolated widgetsOnly island codeContent sites with small interactive parts
React Server ComponentsRSC payload, often plus HTMLOnly client componentsData-heavy apps with selective interactivity
RSC compared with related rendering approaches

RSC resembles islands architecture in that static parts carry no client code, but it keeps one React tree and supports client-side routing with preserved state, which island frameworks such as Astro handle differently.

When to choose server components

The practical rule is to keep components on the server unless they need interactivity or browser-only APIs. Moving the client boundary as deep into the tree as possible, often to a single button or input, gives the largest bundle savings.

SituationRecommended typeReason
Product list loaded from a databaseServer componentData access without an API round trip
Markdown rendering with a large parserServer componentParser library never reaches the browser
Search box with live filteringClient componentNeeds state and keyboard events
Layout with a theme toggleServer layout, client toggleKeeps the boundary small
Chart using canvas or windowClient componentDepends on browser APIs
Choosing a component type by situation

Limitations and common mistakes with RSC

React Server Components add architectural complexity: developers must reason about two module graphs, serialization rules and framework-specific caching. RSC also requires a bundler and framework integration, so it cannot simply be dropped into an existing single-page application built with a basic setup.

  • Passing non-serializable props, such as functions or class instances, from a server component to a client component causes errors; only plain data, JSX and Server Action references can cross the boundary.
  • Placing `”use client”` too high in the tree pulls large subtrees into the bundle and removes most of the benefit.
  • Leaking secrets happens when server-only modules are imported by client files; the server-only package and environment variable conventions help prevent this.
  • Request waterfalls appear when nested server components await data sequentially; parallel fetching and Suspense boundaries reduce the latency.
  • Treating Server Actions as private is a security error, because every action is a publicly callable endpoint that needs authentication and input validation.

Put simply

Most websites built with React send the browser a large package of code so the browser can build the page itself. React Server Components change this. Parts of the page that only show information are built on the server, and the browser receives the finished result, much like receiving a printed menu instead of the recipe for printing it.

Only the parts that react to clicks and typing, such as buttons and forms, send their code to the browser. The key takeaway is that pages load less code and can still feel interactive, because each piece runs where it makes the most sense.

In practice

An online bookstore rebuilds its catalog pages with Next.js App Router. The book detail page previously shipped a Markdown parser, a date library and data-fetching code to every visitor, and the page needed a separate API request after loading before reviews appeared.

After the migration, the page, the description renderer and the review list are server components that query the database directly. Only the add-to-cart button and the rating widget are client components. The JavaScript downloaded for the page drops substantially, the reviews arrive in the first streamed response, and the add-to-cart flow uses a Server Action that checks the session and stock on the server. The result is a faster first view on mobile devices with no loss of interactivity.