Rendering Environments

Next.js allows us to develop a hybrid web application that creates user interfaces in both the client environment and server environment.


By default, Next.js renders your components at the server, in one of the following ways:

You should use a server component, when you want to:

Server Components in Next.js are rendered through a process involving React's APIs, where the rendering is divided into chunks based on route segments and Suspense Boundaries.

On the Server: React renders Server Components into a special data format called the React Server Component Payload (RSC Payload). Next.js uses this payload and Client Component JavaScript instructions to generate HTML on the server.

On the Client: The server-rendered HTML provides a fast, non-interactive preview of the route (for the initial page load only).The RSC Payload is then used to reconcile the Client and Server Component trees and update the DOM.JavaScript instructions are used to hydrate Client Components, making the application interactive.

React Server Component Payload (RSC): The RSC Payload is a compact binary representation of the rendered Server Components tree. It includes:


To designate a component as a client component, include the "use client" directive at the top of the component file.

You should use a client component, when you want to:


You can import a client component into a server component, but you can't import a server component into a client component.