New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix duplicated global style blocks #4
Conversation
85c054f
to
f3b4ad4
Compare
f3b4ad4
to
189765b
Compare
189765b
to
84641fe
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good; cc @bpierre perhaps we should set the peer dependency range on aragonUI to be ^4
instead of >= 4
?
package.json
Outdated
@@ -41,7 +41,7 @@ | |||
"react": "^16.13.1", | |||
"react-dom": "^16.13.1", | |||
"react-spring": "^8.0.1", | |||
"styled-components": "^5.1.1" | |||
"styled-components": "4.4.1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps we can still leave this with a ^
for the 4.x range
We could do that yes, but I suspect it will break apps already already using aragonUI with styled-components v5. I would like to understand the issue as aragonUI should work with v5. @andy-hook could you tell me how to reproduce? It seems to work fine with the devbox or the client. 🤔 Edit: in any case, it’s probably a good idea to use |
I think I've identified the issue with fresh eyes today. See styled-components/styled-components#3008 Edit: You can repro in the client by wrapping the root in Knowing this, a better fix in this project might be to nest |
84641fe
to
b55b1ad
Compare
The upgrade to styled-components v5 was causing duplicate global style blocks to be rendered in the head. They seemed to originate from
<Main/>
in aragon/ui. For now I think it's best to pin it to v4.@delfipolito this should resolve the issue we discussed with HMR reloads.