Skip to content
Discussion options

You must be logged in to vote

According to the documentation page on the topic, you will need to mark providers as client components using use client. You don't need to use use client in your layout. Just import your theme provider and use it. I hope that answers your question.

Important

Wrapping a server component inside a client component doesn't automatically convert it into a client component.

// <ServerComponent /> is still a server component.
<ThemeProvider>
  <ServerComponent />
</ThemeProvider>

A server component is automatically converted to a client component when it is directly imported into a client component file.

"use client"
import ServerComponent from "./ServerComponent"
// ...

<ServerComponent /> // …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by hydroperx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants