Skip to content
Learn Netverks

Lesson

Step 12/36 33% through track

server-components

React Server Components

Last reviewed May 28, 2026 Content v20260528
Track mode
client_nextjs
Means
In-browser Next.js (client components)
Reading
~2 min
Level
intermediate

This lesson

This lesson teaches React Server Components: the concepts, APIs, and habits you need before advancing in Next.js.

Without React Server Components, you will struggle to read or extend Next.js codebases and playground exercises.

You will apply React Server Components in contexts like: Marketing sites, dashboards, e-commerce, and Vercel-style deployments that need hybrid static + dynamic pages.

Write TSX for Client Components, click Run—React 18 CDN + in-browser TSX compile; use client/server lessons explain App Router concepts; mountApp renders interactive UI; printOutput feeds the terminal. Also read server-component lessons carefully—SSR runs in a real Next project, not in the iframe.

When you can explain the previous lesson's ideas without copying starter code.

React Server Components (RSC) run on the server during a request (or at build time). They can read databases and filesystems directly, keep secrets off the client, and send less JavaScript to the browser. In the App Router, components are Server Components by default.

What Server Components can do

  • Async/await data fetching in the component body
  • Access server-only modules (ORM, env secrets)
  • Render large static subtrees without shipping their logic to the client

What they cannot do

  • useState, useEffect, or browser event handlers
  • Access window, localStorage, or DOM APIs
  • Use most client-only third-party widgets without a Client Component wrapper

Example (real project)

// app/products/page.tsx — Server Component (no directive)
export default async function ProductsPage() {
  const products = await db.product.findMany();
  return (
    <ul>
      {products.map((p) => <li key={p.id}>{p.name}</li>)}
    </ul>
  );
}

Important interview questions and answers

  1. Q: Server Component vs SSR?
    A: SSR is a delivery timing; RSC is a component type that never hydrates on the client unless serialized as part of a client boundary.
  2. Q: Can Server Components import Client Components?
    A: Yes—as children or props. Client Components cannot import Server Components (they would pull server code into the bundle).
  3. Q: Default in app/?
    A: Server Component unless the file starts with 'use client'.

Self-check

  1. Why can an RSC query a database without an API route?
  2. Name two hooks forbidden in Server Components.

Tip: Default to Server Components—push 'use client' to the smallest interactive leaf, not the page root.

Interview prep

What can Server Components not do?

No hooks, event handlers, or browser APIs—they run on the server and send rendered output (and RSC payload), not client-side component logic.

Interview tip Lesson completion confidence

Can you explain this lesson in 30 seconds without reading notes?

Not saved yet.

Playground

Runs in your browser in a sandboxed frame. Backend runners appear when this track’s profile allows them.

Check yourself

Multiple choice — immediate feedback.

Discussion

Past discussion is visible to everyone. Only logged-in users can post comments and replies.

Starter discussion topics

  • Why async components?
  • What cannot run on server?

Sign up or log in to post comments and sync lesson progress across devices.

No discussion yet. Be the first to ask a question.

Jump