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

What 'use client' Actually Declares

Understanding that 'use client' marks a module boundary where code transitions from server to client execution.

What 'use client' Actually Declares

You'll learn what the 'use client' directive truly marks in your React application architecture.

It's a Boundary, Not a Component Label

Many developers think 'use client' means "this component runs on the client." That's misleading. The directive actually marks a module boundary—the point where your code transitions from server execution to client execution.

Think of it like a border crossing between two countries. You don't declare every person in the destination country; you mark the entry point. Everything that crosses that border (imports from that module) enters client territory.

What Actually Happens

When you add 'use client' to the top of a file:

'use client'

export function Counter() {
  const [count, setCount] = useState(0)
  // ...
}

You're declaring: "This module and everything it imports must be included in the client JavaScript bundle." React sees this boundary and knows to stop server execution here. The component tree can continue on the server until it hits a Client Component, at which point React switches modes.

The Boundary Flows Downward

Crucially, once you cross into client land, you stay there. If Counter imports Button, then Button is also a Client Component—even without its own 'use client' directive. The boundary declaration is transitive.

Server Components above this boundary can render Client Components below it by passing serializable props across the boundary, but they never execute client-only code themselves.

Key Takeaway: 'use client' marks an entry point in your module graph where execution shifts from server to client, not just a single component's runtime.