Lesson 2.1

What server components actually do

Server components run on the server and send rendered output rather than code. That is why they can read a database directly and why they add nothing to your bundle.

Duration
16m
Level
Intermediate
Students
15k students

Overview

Server components run on the server and send rendered output rather than code. That is why they can read a database directly and why they add nothing to your bundle.

In this lesson you will:

  • Render on the server and ship no component code to the client
  • Read data and secrets directly, without an API round trip
  • Understand why server components cannot hold state or effects

Resources

Next.js documentation

The official reference for the tools used in this lesson.

React docs: Server Components

The upstream React explanation the Next.js implementation follows.