Course contentsShow
← React
Lesson 1523 of 2,39638. Server Components FundamentalsFree lesson

The Zero-JS Promise: When It's True

Pure Server Components with no interactivity ship zero JavaScript, reducing bundle size dramatically for static content.

The Zero-JS Promise: When It's True

You'll learn when React Server Components actually ship zero JavaScript to the browser — and when they don't.

The Promise Explained

React Server Components come with a compelling pitch: pure server components that contain no interactivity ship zero JavaScript to the client. This isn't marketing hype — it's literally true, but only under specific conditions.

When a Server Component renders purely static content (text, images, structural HTML) without event handlers, state, or effects, React doesn't include that component's code in your JavaScript bundle. The server executes the component once, generates HTML, and sends only that HTML to the browser. The component code itself never travels across the network.

When Zero-JS Is Actually Zero

The promise holds true when your Server Component:

  • Renders only static markup
  • Contains no useState, useEffect, or other hooks
  • Has no onClick, onChange, or any event handlers
  • Doesn't import client-side libraries
  • Only fetches data on the server

Think of it like a restaurant menu printed on paper. The menu describes the dishes (HTML), but you don't need the chef's recipe book (JavaScript) delivered to your table to read it.

When JavaScript Still Ships

The moment you add interactivity — even a single onClick — that component must become a Client Component (marked with 'use client'), and its code ships to the browser. However, Server Components that use Client Components still benefit: only the Client Component's code ships, not the entire tree.

Key Takeaway: Server Components with pure static content ship literally zero JavaScript for that component, dramatically reducing bundle size for content-heavy pages. The promise breaks the instant you need interactivity in that specific component.