Server Components render on the server, can access backend resources directly, and don’t support client hooks/events. Client Components run in the browser, can use `useState/useEffect` and event handlers, but add JS to the bundle.
In the App Router, components are **Server Components by default**. A Server Component renders on the server and sends a lightweight representation to the client (not its JS). This enables:
Client Components run in the browser. They’re used for interactivity (state, effects, event handlers) but increase the JS shipped to users.
// Server Component (default)
export default async function Page() {
const user = await getUser();
return <UserProfile user={user} />;
}
// Client Component
'use client'
function UserProfile({ user }: { user: { name: string } }) {
return <button onClick={() => alert(user.name)}>{user.name}</button>;
}