-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
React 19 Types Support #3186
Comments
WorkaroundUse pnpm patch --edit-dir ./node_modules/.pnpm-patch-emotion-react @emotion/react
cd ./node_modules/.pnpm-patch-emotion-react
npx types-react-codemod@latest preset-19 .
cd ../..
pnpm patch-commit ./node_modules/.pnpm-patch-emotion-react
rm -r ./node_modules/.pnpm-patch-emotion-react
pnpm patch --edit-dir ./node_modules/.pnpm-patch-emotion-styled @emotion/styled
cd ./node_modules/.pnpm-patch-emotion-styled
npx types-react-codemod@latest preset-19 .
cd ../..
pnpm patch-commit ./node_modules/.pnpm-patch-emotion-styled
rm -r ./node_modules/.pnpm-patch-emotion-styled |
We'll get to work on this once React 19 gets published. |
It got released in April. |
It didn't. It's an RC version, not a stable one.
I hope your team sponsors that work instead of relying on free labor in a demanding way. |
Actually, we don't use the @emotion packages directly. |
@andreibicu then do it yourself. |
Thanks for your lib! We are using it through Chakra-UI in our NextJS application. NextJS 15 App Router is using React 19 RC: We will not be able to upgrade while Thanks! |
The rough estimate is "in the future". It's not even obvious if we are going to be able to support React 19 types in Emotion 11. We'll definitely be working on Emotion 12 though and that will be compatible with React 19. |
Sadly, this didn't work for me. Just wanted to come around and +1 this issue. Given next 15 says that react 19 is a requirement (even though it's still in RC), using "jsx": "preserve",
"jsxImportSource": "@emotion/react", in my |
React 19 was just released today. Yay 🎉 |
This was fixed in #3206. Creating a new project using Next 15 and React 19 for example, works completely fine. The future work mentioned in #3186 (comment) will likely make Emotion require less setup but it already currently works and relevant to this particular issue, the types work so I'm closing this. |
The problem
Using React 19 with the version of TypeScript types mentioned in the upgrade guide (using pnpm overrides to avoid mismatching types) causes failures with the Emotion types:
@jsxImportSource of @emotion/react
@emotion/styled
Relevant parts of my
package.json
:Proposed solution
@emotion/react
and@emotion/styled
should be updated to support React 19Alternative solutions
No viable alternatives I can think of, apart from not supporting React 19+
Additional context
--
The text was updated successfully, but these errors were encountered: