Feature Request: Remove global (createGlobalStyles) styles on unmount
See original GitHub issueI am implementing a web-app using single-spa
and as part of this we have different react apps load in to our html document as the user navigates between sub-apps.
Ideally the use of createGlobalStyles
would only persist while the component defining these props was mounted, and they would be removed when this component (and in my case the app loading them) is removed.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:13
- Comments:6 (1 by maintainers)
Top Results From Across the Web
FAQs - styled-components
When using global styling APIs like createGlobalStyle or the former injectGlobal, adding and removing certain styles from the DOM like @font-face definitions ...
Read more >How to update or remove global styles in Emotion
Learn how to change globally injected styles in Emotion without breaking the rest of your app's styles.
Read more >How To Use Styled-Components In React - Smashing Magazine
Styled components remove unused styles, even if they're declared in your code. and many more.
Read more >EventTarget.removeEventListener() - Web APIs | MDN
The removeEventListener() method of the EventTarget interface removes an event listener previously registered with EventTarget.
Read more >Emotion 10: CSS-in-JS with Flexible Scoped and Global ...
The displayed div will show a centered pink text. Global styles are updated/removed when the styles change or when the Global component unmounts...
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
I’m unsure why this was closed but this feature would be super useful.
+1 for reopening this