Question related to "use client"
Answered
Herring Gull posted this in #help-forum
Herring GullOP
If I put a context provider in root layout, does that make other routes become "use client" too?
Answered by Ray
no, because the children of client component can be server component
https://nextjs.org/docs/app/building-your-application/rendering/composition-patterns#supported-pattern-passing-server-components-to-client-components-as-props
https://nextjs.org/docs/app/building-your-application/rendering/composition-patterns#supported-pattern-passing-server-components-to-client-components-as-props
2 Replies
no, because the children of client component can be server component
https://nextjs.org/docs/app/building-your-application/rendering/composition-patterns#supported-pattern-passing-server-components-to-client-components-as-props
https://nextjs.org/docs/app/building-your-application/rendering/composition-patterns#supported-pattern-passing-server-components-to-client-components-as-props
Answer
Herring GullOP
Thanks