createGlobalStyle is reproducing wrong styling in production mode
See original GitHub issueEnvironment
Node v10x
Reproduction
Its a react app, and I pass some styles including css reset and body, html
basic styles using createGlobalStyle
which works perfectly fine when working locally. However, I noticed the same styles are being ignored or didn’t get imported when application is built using webpack production mode.
See results below. Tried many different tests, but it seems to be behaving indifferently which maybe caused by bug within css string to style tag compilation.
Steps to reproduce
Build script using webpack production mode.
Expected Behavior
Actual Behavior
Issue Analytics
- State:
- Created 5 years ago
- Reactions:4
- Comments:9 (5 by maintainers)
Top Results From Across the Web
Styled Component v5.3 createGlobalStyles not Working
Is the error message not enough? It is saying that GlobalStyle doesn't render children. See styled-components.com/docs/api#createglobalstyle ...
Read more >Build a React theme switcher app with styled-components
In this tutorial, we demonstrate how to build a custom theme switcher for a Game of Thrones-themed React app using styled-components.
Read more >styled components not working in prod nextjs - You.com
js projects using MUI + styled-components based on the example configuration from:\ have incorrect MUI components styling on production. The order of the...
Read more >Reactjs PopUp: Easily Create Popups in React - CopyCat Blog
import { createGlobalStyle } from 'styled-components'. function App() { ... Common Issues While Building Reactjs PopUp in production.
Read more >Theming styled-components with CSS custom properties
They are supported on 94.75% of the browser market share, so it's even production-ready. Defining a custom property is like setting a CSS ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@probablyup Nice! It has been great experience working with this library. Love to contribute next time!
Can you try something like this and let us know? The thing is, in your example. The CGS runs on every render, which means the same styles are injected each time they are created which leaks memory. Can you try this eg and let me know?