Next.js Discord

Discord Forum

Context in server components

Answered
Mini Lop posted this in #help-forum
Open in Discord
Mini LopOP
if i have a large component that needs to be client side, like to access a value from a context to use that value in several parts inside would it, make more sense to keep this whole component with the use client and split it into some smaller server side components passing this value through props? or keep it server side, split it into smaller client side components and access the context value within these smaller components?
Answered by fuma
As the docs said, client component should be the leaf, which means you should split it into several smaller client components instead of passing server components through props.
View full answer

3 Replies

As the docs said, client component should be the leaf, which means you should split it into several smaller client components instead of passing server components through props.
Answer
Mini LopOP
ah, so i am heading in the right direction
:thank_you: