Skip to content
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

Theme spacing doesn't work on the new version of emotion-theming #1048

Open
mberneti opened this issue Nov 14, 2020 · 9 comments
Open

Theme spacing doesn't work on the new version of emotion-theming #1048

mberneti opened this issue Nov 14, 2020 · 9 comments

Comments

@mberneti
Copy link

Theme spacing doesn't work on the @emotion/react (new version of emotion-theming) theme provider.

@mberneti
Copy link
Author

Check this issue on this sandbox link. (The padding value were expected to be equal to 1rem)
https://codesandbox.io/s/trusting-tdd-os292?file=/src/App.js

@jake-nz
Copy link

jake-nz commented Nov 16, 2020

I believe this is because you're providing context via @emotion/react -> ThemeProvider but Rebase still gets context from emotion-theming -> ThemeProvider. Those are two different contexts :(

This will require a major version bump for rebass but we haven't seen any release at all for over a year. I'm worried that this might never happen.

@acandael
Copy link

I think I have the same issue. I get this error in my Next.js application:

Error: The @emotion/core package has been renamed to @emotion/react. Please import it like this import { jsx } from '@emotion/react'.

in _api.js I have this import:

import {ThemeProvider} from '@emotion/react'

@Flavien-Pensato
Copy link

@emotion/react is not compatible with the current version of emotion.

#1051

@theoparis
Copy link

theoparis commented Dec 20, 2020

I can't use emotion-theming because there isn't typescript support or type definitions for it, so that's why I've tried to use @emotion/react. However, this doesn't import the theme at all... same issue here

@ghost
Copy link

ghost commented Jan 9, 2021

Theme providing does not work with @emotion/react, I can't change any styles, they are not applied at all :(

@jtparrett
Copy link

Same here. Has anyone looked into the source to see if it’s much work to open a PR with the fix? I may have a look if not.

@gitgudchannel
Copy link

This is really sad, is there anything out there similar to rebass?

@Alameen688
Copy link

Alameen688 commented Mar 12, 2021

You can add a specific working version of emotion-theming to your package.json, (then run npm install) that still works instead of the latest version that gives that error.
e.g "emotion-theming": "^10.0.27",

NB: To use imports like Global you would need to install @emotion/core separately
import { Global } from '@emotion/core'; which is something you wouldn't have to do if using @emotion/react

I think I have the same issue. I get this error in my Next.js application:

Error: The @emotion/core package has been renamed to @emotion/react. Please import it like this import { jsx } from '@emotion/react'.

in _api.js I have this import:

import {ThemeProvider} from '@emotion/react'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants