You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The babel plugin injects parameters to any function call for a function with the name css. This generally works, but it's possible to have a function named css that isn't emotion's css. In this case, the results are very unexpected.
I ran into it using the Webpack Blocks library, which uses css as a function shorthand for the webpack css loader.
Suggested solution:
Before doing any code transformations, check to see if emotion is even imported. This is still naive since variable shadowing could make css in a function scope still not be emotion's css despite emotion's css being imported, but it's an improvement.
The text was updated successfully, but these errors were encountered:
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.
emotion
version: 9.1.1Problem description:
The babel plugin injects parameters to any function call for a function with the name
css
. This generally works, but it's possible to have a function namedcss
that isn't emotion'scss
. In this case, the results are very unexpected.I ran into it using the Webpack Blocks library, which uses
css
as a function shorthand for the webpack css loader.Suggested solution:
Before doing any code transformations, check to see if emotion is even imported. This is still naive since variable shadowing could make
css
in a function scope still not be emotion's css despite emotion's css being imported, but it's an improvement.The text was updated successfully, but these errors were encountered: