Style componentes
Unanswered
Giant panda posted this in #help-forum
Giant pandaOP
is there a way to use styled of styled components in server side rendering ?
9 Replies
Broad-snouted Caiman
Giant pandaOP
i have implement that but when a use a componend that includes styled, it says that i have to use 'use client'
Broad-snouted Caiman
what you have inside that component ?
Giant pandaOP
jus a component that is using styled.div
Error: createContext only works in Client Components. Add the "use client" directive at the top of the file to use it. Read more: https://nextjs.org/docs/messages/context-in-server-component
Shy Albatross
last time I checked, styled-components use contex for their provider, so anywhere you use them you have to make client comp, which sucks
@Shy Albatross last time I checked, styled-components use contex for their provider, so anywhere you use them you have to make client comp, which sucks
Somali
No way around this? Does this mean you can’t SSR with them?
Great golden digger wasp
you can SSR but you cant use styled-components in RSC right now
Giant pandaOP
is there a way to pass media queries as props to a compoennt? and if so i allows you to do in the server side ?