How to use a styled-components based ui library with my NextJS app #16833
Unanswered
mayckcoelho
asked this question in
Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I would like to use in my next.js app a shared ui library based in styled-components. That library exports its own themes, ThemeProvider, components and behaviors. But until now, I'm not able to configure properly since the library access de document, so I think it needs to be loaded in the client.
I tried to use dynamic import, configure the
_document
with the ServerStyleSheet like styled-components docs, configurebabel.config.js
(that I'm far from an expert), and even create a component that checksif (typeof window !== 'undefined')
, but I'm still gettingdocument is not defined
error T_TI was able to use styled-components, so my s-c configuration is right, but the ui library doesn't work.
Is there something that I missed?
Beta Was this translation helpful? Give feedback.
All reactions