Error "createContext only works in Client Components" #4091
Unanswered
Yippiekaiaii
asked this question in
Q&A
Replies: 1 comment
-
yeah, as the error suggests, add a You can read more about using styled components together with Next.js 13.4+ in their docs |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am trying to use styled components in my app and i am getting the error below, can anyone help with it:
TypeError: 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
Its within a Next.js component which at the moment is just a navbar.
Below is my code so far:
Below is my package.json so you can see my versions:
Beta Was this translation helpful? Give feedback.
All reactions