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

What Gets Sent: HTML vs JavaScript Bundles

Server Components render to a special format that ships no JavaScript to the client, unlike traditional React components.

What Gets Sent: HTML vs JavaScript Bundles

You'll learn the fundamental difference between what Server Components and traditional React components send to the browser.

The Traditional React Model

Until now, every React component you've written ships JavaScript to the client. When a user visits your page, the server sends HTML (often minimal), but the real magic happens when your component bundle downloads and "hydrates" that HTML. The entire component tree, logic, props, and dependencies travel as JavaScript code that executes in the browser.

// Traditional component (Client Component)
function UserProfile({ userId }) {
  const [user, setUser] = useState(null);
  // All this code ships to the browser
  useEffect(() => {
    fetch(`/api/users/${userId}`).then(/*...*/);
  }, [userId]);
  return <div>{user?.name}</div>;
}

This component becomes part of your JavaScript bundle. The browser downloads it, parses it, executes it.

The Server Component Difference

Server Components render on the server and send only the HTML-like output, not the component code itself. The component logic, imports, and dependencies stay on the server. The client receives a special serialized format describing what to display—no JavaScript for that component at all.

Think of it like ordering food: traditional React sends you the recipe and ingredients (JavaScript), expecting you to cook (execute). Server Components send you the finished dish (rendered output).

Why This Matters

Zero JavaScript means zero parsing, zero execution, zero bundle size impact. Your page loads faster and runs with less overhead. The interactivity you need comes only from Client Components you explicitly mark.

Key Takeaway: Server Components send rendered output to the browser, not JavaScript code, fundamentally changing what users download and execute.