Warn when multiple instances of Emotion are used
See original GitHub issueThe problem
When multiple instances of Emotion are used (specifically, @emotion/core
), theming and other parts of the library stop behaving correctly.
Proposed solution
Following the React way to solve this problem, we should put a check in Emotion to warn the user if multiple versions are being used together.
Alternative solutions
Alternatively we could store the whole Emotion context into a global variable and use it instead of defining a new one for each instance, but I’m not sure about possible downsides of this approach.
Additional context
For reference, here’s the React PR where the check was first introduced: https://github.com/facebook/react/pull/3579
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:9 (6 by maintainers)
Top Results From Across the Web
Warning Signs and Risk Factors for Emotional Distress
Learn about the common warning signs and risk factors for emotional distress that children, adults, and first responders often experience.
Read more >Why you shouldn't use @emotion/core - Colin McDonnell
Emotion is my favorite CSS-in-JS library. It's easy to define style classes — both inline or in separate files. You can powerfully compose ......
Read more >Create metric-based alert policies - Monitoring - Google Cloud
An alerting policy can notify you when the number of processes is more than, or less than, a threshold. For information about which...
Read more >Module 2: Understanding Children's Developmental Milestones
For example: Pretending to be something else during play with others (teacher, superhero, dog) can be a social/emotional milestone as well as cognitive ......
Read more >The 6 Types of Basic Emotions - Verywell Mind
For example, basic emotions such as joy and trust can be combined to create love. A 2017 study suggests that there are far...
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
This got merged into v11 branch.
In any case, this issue aims to provide a way to easily debug the issue, not to provide a solution to the multiple theme contexts. I’m saying this just in case you guys find an issue for this specific problem and may decide this issue can be closed.