0

Server Components by default

Modelused in ~100% of apps

Every component you write in the App Router is, by default, a Server Component — it runs ONLY on the server and ships ZERO JavaScript to the browser. Most tutorials get this exactly backwards ("React runs in the browser"), and that single wrong mental model is the root of half the caching, secret-leaking, and bundle-size bugs juniors ship. Fix it here and the rest of Next.js stops feeling like magic.

Core idea. In the App Router a component with no directive is a React Server Component (RSC): its code executes once, on the server, during the request; the browser receives the rendered output (HTML + a serialized RSC payload) but never the component's source code. So a Server Component can be `async`, can `await` a database call, can read `process.env` secrets, and adds nothing to the client bundle — because it is not, and never will be, a thing that runs in the browser.
Playground, this isn't a screenshot
component tree server client
<LikeButton />Server Component
Build error: useState / onClick are not allowed in a Server Component. Add "use client" to fix it.
Render HTML / read props
await data directly (db, fetch)
useState / useEffectclient only
onClick & event handlersclient only
window / localStorageclient only
JS shipped to browser0 KB
JavaScript shipped to the browser0 KB / 71 KB if all client

2 interactive component(s) are still Server Components— they would crash the build because Server Components can't use state or event handlers. Select one and add "use client".

↑ play a little first, then dig in