Passing Theme Context into a Sever Side Component
Unanswered
Lilac posted this in #help-forum
![Avatar](https://cdn.discordapp.com/embed/avatars/5.png)
LilacOP
The docs say we should wrap a context provider in a client component and then place it in the root.
But what if we need to pass this context like a theme or user auth info down to server components as well?
Since server components cannot use context
But what if we need to pass this context like a theme or user auth info down to server components as well?
Since server components cannot use context
8 Replies
![Avatar](https://cdn.discordapp.com/embed/avatars/1.png)
Northern Wheatear
Actually you can do this
This is an example
![Image](https://cdn.discordapp.com/attachments/1181702922497708153/1181728472410894387/image.png?ex=65821d67&is=656fa867&hm=c70d9295b4247873f7bc179a35019f59527a2c40703701500b4746214eef2369&)
Using suspense is optional there
![Image](https://cdn.discordapp.com/attachments/1181702922497708153/1181729277314601041/image.png?ex=65821e27&is=656fa927&hm=69c69337243ec6db19a13307d86c6f59c01624eba1d7d68c3d41dd348ce454fa&)
This is the datawrapper component which gets data from db and passes it to a context provider
Then the AppLayout in my RootLayout contains the rest of the layout which needs the data from context...
![Avatar](https://cdn.discordapp.com/embed/avatars/5.png)
LilacOP
But only client components can access context