Replies: 2 comments 1 reply
-
create a lib folder at the same level as app in which you add a
|
Beta Was this translation helpful? Give feedback.
-
While trungphanhthanh's solution works, it's not how it's described in the official documentation. According to https://nextui.org/docs/guide/upgrade-to-v2, you have to tweak the import path
For example:
This way, you keep the code more streamlined without any intermediary file. Granted, it's a pain when you add a lot of component types as each takes 1 line. |
Beta Was this translation helpful? Give feedback.
-
Just finished setting up NextUI into my NextJS project. but now I can't use the NextUI Components on Serverside. I'm getting
"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" on every page, I can't just add "use client" to every page.
Beta Was this translation helpful? Give feedback.
All reactions