Server and Client Components allow developers to build applications that span the server and client, combining the rich interactivity of client-side apps with the improved performance of traditional server rendering.
React Server Components introduce a new mental model for building hybrid applications that leverage the server and the client.
Instead of React rendering your whole application client-side (such as in the case of Single-Page Applications), React now gives you the flexibility to choose where to render your components based on their purpose.
Server Components allow developers to better leverage server infrastructure. For example, you can move data fetching to the server, closer to your database, and keep large dependencies that previously would impact the client JavaScript bundle size on the server, leading to improved performance.
The initial page load is faster, and the client-side JavaScript bundle size is reduced.
Additional JavaScript is only added as client-side interactivity is used in your application through Client Components.
Client Components enable you to add client-side interactivity to your application.
The use client directive is a convention to declare a boundary between a Server and Client Component module graph.
Unsupported Pattern
Recommended Pattern:
Passing Server Components to Client Components as Props