Performance: Zero bundle size for server components
This concept affects the initial page load speed by reducing the JavaScript sent to the browser, improving Largest Contentful Paint (LCP).
export default function ServerComponent() { return <div>Hello from server</div>; }
'use client'; import React from 'react'; export default function ClientComponent() { return <div>Hello from client</div>; }
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Client Component | Creates DOM nodes on client | Triggers 1 reflow per component | Moderate paint cost | [X] Bad |
| Server Component | Server sends static HTML | No reflows from JS | Minimal paint cost | [OK] Good |
export default function MyComponent() { return <div>Hello</div>; } has no "use client" directive, so it is a server component with zero bundle size.export default function Greeting() {
const message = 'Hello from server';
return <h1>{message}</h1>;
}"use client";
export default function UserName() {
const name = fetchUserName();
return <div>{name}</div>;
}Pass the test and this pattern moves unknown