React Server Components, explained like a kitchen

Server Components confuse people because the mental model is missing. Here's the kitchen picture that makes the split click, and the rules that keep it clean.

Prabir Singh, profile photoPrabir Singh·
·Updated ·9 min read
Editorial illustration: A cutaway kitchen prepares a finished plate that passes through a clear serving boundary.
In this article
  1. 01The split is about where the work happens
  2. 02Why the plate is smaller
  3. 03The seam is where people get burned
  4. 04Where I actually draw the line
  5. 05A boundary review you can do in ten minutes
  6. 06Frequently asked questions
  7. 07Heavy work in the back, a clean plate out front

Forget the tech for a second. Picture a restaurant kitchen.

The kitchen preps everything out of sight. Raw ingredients, the walk-in fridge, the recipes nobody at the table should see. By the time a plate reaches you, the mess is gone. You get the finished dish, not the chopping board.

That's a React Server Component. It does its work on the server, close to the data, and sends the diner a finished plate. The browser never sees the fridge.

Once that picture is in your head, most of the confusing rules stop being rules. They become common sense about restaurants.

The split is about where the work happens

Not what the component looks like. Where it cooks.

Server Components are the kitchen

A Server Component runs on the server. It can read the database, hold secrets, and pull in heavy libraries without shipping any of that to the browser. What the user receives is the result, not the machinery.

// Server Component (the default). Runs on the server, ships no JS of its own.
async function Post({ id }: { id: string }) {
  const post = await db.post.findById(id) // the fridge, hidden from the diner
  return <article>{post.body}</article>
}

Notice the async. A Server Component can simply await its data during render. No effect, no loading flag, no second round trip from the browser.

Client Components are the table

A Client Component is the part of the meal the diner finishes at the table. The sizzling plate. The thing you poke, stir, and react to. State, effects, event handlers, browser APIs, anything that responds to a click lives here and ships as JavaScript.

"use client"
import { useState } from "react"
// Client Component. Ships to the browser because it needs to react.
export function LikeButton() {
  const [liked, setLiked] = useState(false)
  return <button onClick={() => setLiked(!liked)}>{liked ? "♥" : "♡"}</button>
}

Who does what

The Next.js docs split it cleanly, and the kitchen maps onto it almost line for line.

JobKitchen (Server)Table (Client)
Fetch from the database or an APIYes, close to the sourceOnly through a request
Use API keys and secretsYes; never render or pass them to the clientNever
Heavy libraries (markdown, dates)Yes, at no cost to the browserShipped to every visitor
useState, useEffect, event handlersNoYes
Browser APIs like localStorageNoYes
Can be asyncYesNo

Why the plate is smaller

The old model shipped the whole kitchen to every table. Your data-fetching code, your date library, your markdown parser, all bundled and sent to the browser so it could rebuild the page there. Fast laptops hid the cost. Budget phones on a patchy connection did not.

Server Components leave the kitchen in the back. The React docs show exactly this: a component that uses marked and sanitize-html to render markdown, where neither library ends up in the bundle. The browser gets the rendered output and nothing else. Less to download, less to parse, and your keys stay where the knives are.

The door, not the dish

Here's the part that surprised me, and it changes how you place the boundary.

"use client" doesn't mark a component. It marks a door. Once a file has it, its transitive module dependencies become part of the client graph. Server-rendered children passed from a server parent are a different case, explained below. So one careless "use client" at the top of a big page doesn't just move one component to the table. It wheels the whole prep station out into the dining room.

Push the door as far down as it goes

Keep the page a Server Component, and hand the one button that needs state its own small client island. The Next.js docs recommend exactly this to keep bundles small: put the directive on the interactive pieces, not on large chunks of UI.

A whole page marked "use client" is a kitchen that sends every diner the raw ingredients. Technically it works. It also defeats the point.

The seam is where people get burned

The tricky part isn't either side. It's the pass between them. A few rules save most of the pain.

Only plates cross the pass

Props from a Server Component to a Client Component must be serializable. Strings, numbers, plain objects, arrays, dates: fine. A database connection or a class instance: no. A plain function: also no, with one useful exception. The "use client" reference allows Server Functions, the ones marked "use server", to be passed down. That's how a client form calls back into the kitchen without carrying the kitchen with it.

The plate travels. The fridge does not.

The table doesn't walk into the walk-in

Client Components can't be async, and they can't read the database directly. If a client island needs data, the server hands it down as a prop, streams it as a promise the client unwraps with use, or the client asks through a request. Diners order. They don't raid the cold room.

Server inside client, through a slot

A Client Component can't import a Server Component. It can accept one as children. Say you have a modal that needs client state to open and close, and a cart inside it that reads from the database. The modal is a client island with a children slot, the page passes the server-rendered cart into it, and both get to be what they are. Think of it as the server sliding a finished plate onto a trolley the waiter pushes.

Learn the seam and the rest is just React. Fight the seam and every feature feels like swimming upstream.

Where I actually draw the line

My pages are Server Components by default. I reach for "use client" only when a piece genuinely needs to react.

Piece of UIWhere it livesWhy
Article body, case study, pricing tableServerPure content, no reason to ship JS
Navigation links, footerServerStatic, and on every page
Search box, theme toggleClientNeeds state and input
FormsClient island, posting to a Server FunctionInteractive on the table, saved in the kitchen
Animation, live clockClientLives on the browser's timeline

That rule ran through the IT Origin build: most of the site renders on the server and ships as HTML, with client JavaScript only where a human actually clicks, types, or watches something move. Small JavaScript is fast JavaScript; here is what it added up to in PageSpeed on this site. It's the same instinct behind the rest of my stack, and it's a big part of the framework call in Next.js vs TanStack Start. Do the heavy work where the data lives. Ship the diner a clean plate.

A boundary review you can do in ten minutes

Take a hypothetical product page. The server loads the product and chooses the public fields. A small client component owns the quantity selector. The checkout operation authenticates the customer, checks stock and calculates the payable amount again on the server.

Now deliberately change the price in the browser's request. If checkout trusts it, the problem is authorisation and business validation, not where you placed "use client". A beautifully arranged kitchen still needs someone checking the bill.

Review three things: which modules enter the client bundle, which values cross as props, and which operations recheck permissions. Do not pass an entire database row because it is convenient; pass the fields the interface needs. A private note rendered into HTML is public even when the component producing it is server-only.

Also remember that Client Components can be prerendered on the server. Read browser-only APIs in an effect or event handler where appropriate, rather than assuming window exists during render. React's client-boundary reference explains the module boundary; typed validation handles a different part of the problem.

Frequently asked questions

Are Server Components the same as server-side rendering?

No, and the overlap causes half the confusion. SSR turns components into HTML on the server for a fast first paint, then hydrates the client parts in the browser so they become interactive. Server Components never ship their code to the browser at all. In Next.js you get both working together.

Do I have to use them?

In the Next.js App Router, layouts and pages are Server Components by default, so you're already using them. You opt out with "use client" when a component needs interactivity. Most of your tree can stay on the server, and it usually should.

Can a Server Component import a Client Component?

Yes, that's the normal pattern: a server page renders a client island. The reverse is limited. A Client Component can't import a Server Component, but it can receive one as children or another prop, which covers most real cases.

What breaks the first time?

Usually one of two things. Passing a plain function as a prop across the boundary, or calling useState or useEffect in a file without "use client". Both throw clear errors once you know the seam exists, and both stop happening after the first week.

Where do secrets go?

In the kitchen. Read them in Server Components or server-only modules, never in a file marked "use client". In Next.js, NEXT_PUBLIC_ variables are deliberately exposed to the browser bundle. Private values can still leak if you render them or pass them through client props, and the server-only package turns an accidental client import into a build error.

Heavy work in the back, a clean plate out front

Server Components aren't a new framework to learn. They're a line drawn through the one you already know: heavy work in the kitchen, interactivity at the table, and a narrow, honest pass in between. Draw that line well and your pages get lighter, faster, and safer almost for free.

Curious how this shapes a full build? Here's why my APIs start with Hono and how I approach web development. And if you've got a Next.js project that feels heavier than it should, tell me what you're building. I'll show you where the kitchen leaked into the dining room.

Was this useful?

No account needed. One like per browser; click again to undo.

ShareXLinkedInFacebook
Prabir Singh, profile photo

Prabir Singh

Full-stack engineer in Mumbai. Twenty years in sales taught me why people buy; seven years of code taught me how to build what they'll pay for. I still read error messages the way I once read objections: as the most honest feedback of the day. More about me or start a project.

Keep reading