Today, I cover a common mistake to make when using Next.js server and client components. More specifically, it relates to using the use client directive.
In my opinion state management is hardest thing to get right when u r using server components to create complicated software like dashboards. Its so hard, especially with live updates the ony solution is to use something like data revalidation whichs not very good solution most of the time
so in order to handle event trigger we dissect a client components and rest SSR(api calls extra) . generally we nest server component as parent and client component as child . we fetch all nessecary info (api calls) in server componenet and send it to client if needed. is my logic /method correct?
Totally agree with you. In a nutshell, any component that requires user interaction could be set as a client component with the directive. In a recent client project, I have data that is being fetched server side and is rendered onto a client component because I've added a few simple user interactive filters to it. And due to this, the majority of the web pages are rendered server-side. Gotta love that Next.js. 🤩 Ryan, do you have any video that covers the revalidation feature in Next.js? I would love to hear your take on that.