From the course: Master React 19 and Next.js 16 with Hands-On Projects and Real-World Applications

Unlock this course with a free trial

Join today to access over 25,200 courses taught by industry experts.

Interleaving server and client components

Interleaving server and client components

Hello, and welcome! In this session, I'm going to guide you through one of the most powerful features of the Next.js app router – interleaving server and client components. By the end of this session, you'll understand the core principle of how these two types of components can work together. Specifically, I'll demonstrate how you can pass a server component, which is great for fetching data and rendering static content directly as a prop into a client component, which handles user interactivity. This pattern allows you to build highly optimized and interactive user interfaces by composing your UI in a very flexible way. Let's get started where we left off inside our navigation.js file. Let's add a new link for a checkout page. You can see I've inserted a new li element just before the our-team link. Inside it, I've placed a link component with its href attribute set to slash checkout. This new link will allow users to navigate to the checkout page that we are about to build. Let's…

Contents