-
-
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
[@emotion/react
] Regression for importing types in v11.14.0
#3310
Comments
@emotion/react
] Regression for importing types in v11.14.0
Tbf, Why do you even need to access this type? We might expose it from some entrypoint if a compelling use case is presented |
Hey @Andarist , Thanks for the quick feedback. We're not using the import directly, it's an "artifact" of the production bundles (using Preconstruct). What |
What's the input code that generates this declaration file? I can't repro it on this simple TS playground. The generated dts is: export default function Tab(): import("react").JSX.Element; |
We are compiling with Preconstruct and also have a Babel config, which includes for example I assume that would affects how the import is generated? Note that these bundles are from our library component. Would it make sense to use Do you have any other clue or suggestion on what would be a recommended setup?
or
|
I did some testing by using the import("@emotion/react/jsx-runtime").JSX.Element; Would that be more correct / expected? |
Babel configs don't matter much for dts generation.
It should be fine in your case, given you compile the actual JS output using Preconstruct. It should fix up all of the extensionless import statements etc in your output.
That said, I could still use a repro case for the original problem. Maybe there is something I could to to avoid this problem on our side. But I guess your problem isn't really easily fixable because it's caused by a library already compiled with an older version of Emotion installed. We could only try to add this path to increase the backward compatibility but I'm not that inclined to do that right now. Those changes were released months ago and you are the only one reporting this 😅 |
Thanks! We'll go for the If I encounter any more related issues, I'll reach out again. |
Current behavior:
In
v11.13.5
the import@emotion/react/types/jsx-namespace
works as expected.In
v11.14.0
the import@emotion/react/types/jsx-namespace
does not work.To reproduce:
https://codesandbox.io/p/sandbox/emotion-typescript-example-forked-dsrcnf
If you change the version of
@emotion/react
tov11.13.5
it works.PS: the issue might be related with the changes in #3284
Expected behavior:
The import
@emotion/react/types/jsx-namespace
should work.Environment information:
react
version:17.0.2
@emotion/react
version:11.14.0
The text was updated successfully, but these errors were encountered: