Performance: Why server components are the default
HIGH IMPACT
This affects the initial page load speed and reduces client-side JavaScript execution, improving user experience.
export default async function Page() { const data = await fetchData(); return <div>Data: {data.value}</div>; }
'use client' import React from 'react'; export default function Page() { const [count, setCount] = React.useState(0); return <button onClick={() => setCount(count + 1)}>Count: {count}</button>; }
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Client Components by default | More DOM nodes from hydration | Multiple reflows during hydration | Higher paint cost due to JS execution | [X] Bad |
| Server Components by default | Minimal DOM nodes, static HTML | Single reflow on initial load | Lower paint cost, faster display | [OK] Good |