question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Warn when multiple instances of Emotion are used

See original GitHub issue

The 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:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
Andaristcommented, Jan 5, 2020

This got merged into v11 branch.

1reaction
FezVrastacommented, Sep 30, 2019

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found