Server Components run on the server and send only the rendered HTML to the client. This reduces JavaScript bundle size and improves page load speed.
Server Components run on the server, so data fetching happens there. The client receives the final HTML with data already included, avoiding extra client fetches.
Server Components run only on the server, so hooks that depend on the client environment, like useEffect, do not run in them.
export default function MyComponent() { return <div>Hello from Server Component</div>; }
In Next.js App Router, components are Server Components by default. To make a component a Client Component, you add "use client" at the top.
useState is a client-side hook and cannot be used in Server Components, which run only on the server. This causes a runtime error.
