Layout using Theme Provider with "use client" makes the whole site to "use client"?
Answered
Tomistoma posted this in #help-forum
TomistomaOP
Hi there! Let me ask you a question, please. To use the package next-themes to use Dark Mode, it is needed to use a Theme Provider with "use client" and apply it to the layout.tsx. Does that make the whole site to use "use client"? I'm following these steps: https://ui.shadcn.com/docs/dark-mode
Answered by aardani
to set it up correctly: make sure server components are in the children of client components NOT imported inside client components.
3 Replies
to set it up correctly: make sure server components are in the children of client components NOT imported inside client components.
Answer
@aardani to set it up correctly: make sure server components are in the **children** of client components NOT imported inside client components.
TomistomaOP
I see, thank you very much!!