Contents of React Interview Questions

Comprehensive collection of React interview questions and answers covering hooks, components, state management, and best practices.

How are Server Components different from traditional components?

The main difference between Server Components and traditional React components lies in where and how they run:

FeatureServer ComponentsTraditional (Client) Components
Run onServer onlyBrowser (client-side)
JavaScript bundle sizeNo impact — not sent to clientAdds to bundle size
Can access server-side resources (e.g., database, filesystem)YesNo
Interactivity (event listeners)NoYes
Best used forData fetching, heavy computationUI interactions, event handling

In other words:

  • Server Components handle heavy work like data fetching and computation.
  • Client Components handle interactivity like button clicks, input handling, and UI updates.

You can mix Server and Client Components together in the same React tree, giving you fine control over performance and user experience.