Skip to content

Client vs Server Components

Next.js App Router introduces a new paradigm with React Server Components (RSC). Understanding the distinction is crucial for performance and functionality.

Server Components (RSC)

By default, all components in the app directory are Server Components.

  • What: Rendered on the server. The HTML is sent to the client.
  • When to use:
  • Fetching data.
  • Accessing backend resources (DB, API keys).
  • Keeping sensitive logic on the server.
  • Reducing client-side bundle size.

Client Components

To use standard React features like state and effects, you must opt-in to Client Components.