DevPrep
  • Interview Prep
  • Projects
  • Resources
  • Pricing
  • About Us
Submit Question
DevPrep
  • Pricing
  • About Us
Submit Question
  1. Home
  2. Articles
  3. Frontend Engineering
  4. React Server Components: Architecture and Mental Model
XLinkedInReddit
MediumFrontend Engineering

React Server Components: Architecture and Mental Model

D
DevPrep Team
February 10, 2026·1 min read·0
Table of Contents
  • The Core Idea
  • Server vs Client Components
  • The Boundary Rule
  • The Children Pattern
  • When to Use Client Components

Server Components are the biggest paradigm shift in React since hooks. Understanding the mental model is critical.

The Core Idea

Some components only need to run on the server. They can access databases directly, use server-only APIs, and their code never ships to the client.

// Server Component (default in Next.js App Router)
async function UserProfile({ userId }) {
  const user = await db.query("SELECT * FROM users WHERE id = $1", [userId]);
  return (
    <div>
      <h1>{user.name}</h1>
      <p>{user.bio}</p>
      <LikeButton userId={userId} /> {/* Client Component */}
    </div>
  );
}

Server vs Client Components

FeatureServerClient
Render locationServer onlyBoth (SSR + client)
Bundle impactZero JS sentAdds to bundle
State/EffectsNo useState/useEffectFull interactivity
Data fetchingDirect DB/API accessClient-side fetch
Event handlersNoneonClick, onChange, etc.

The Boundary Rule

Server Components can import Client Components, but NOT vice versa. Think of it as a one-way door:

Server Component
  └── can render Client Component ✅
  └── can render Server Component ✅

Client Component
  └── can render Client Component ✅
  └── CANNOT import Server Component ❌
  └── CAN receive Server Component as children prop ✅

The Children Pattern

// Server Component
function Page() {
  return (
    <ClientWrapper>
      <ServerContent /> {/* This works! Passed as children */}
    </ClientWrapper>
  );
}

// Client Component
"use client";
function ClientWrapper({ children }) {
  const [show, setShow] = useState(true);
  return show ? children : null;
}

When to Use Client Components

  • Interactive UI (forms, buttons, dropdowns)
  • Browser APIs (localStorage, geolocation)
  • State management (useState, useReducer)
  • Effects (useEffect, event listeners)
  • Custom hooks that use state or effects

Related Articles

MediumFrontend Engineering

System Design #12: Design a Multi-Step Form Wizard

7 min read
MediumFrontend Engineering

Mastering Senior-Level JavaScript Interview Concepts

2 min read
MediumFrontend Engineering

System Design #9: Design a Collaborative Text Editor

9 min read

Comments (0)

Sign in to leave a comment.

No comments yet. Be the first to comment.

Table of Contents

  • The Core Idea
  • Server vs Client Components
  • The Boundary Rule
  • The Children Pattern
  • When to Use Client Components

Series

View all Frontend Engineering articles →

Practice

  • JavaScript
  • DSA
  • Machine Coding
  • System Design

Resources

  • Learning Tracks
  • Articles
  • Roadmaps
  • Compare Concepts
  • Glossary
  • Developer Tools
  • All Questions

Company

  • About
  • Pricing

Legal

  • Privacy Policy
  • Terms of Service
DevPrep

© 2026 DevPrep. All rights reserved.