Current behavior:
I generated an app using Create React App + Typescript.
I wanted to:
The only way I got the babel plugin to work was through the macro.
Then I started typing my theme using the docs https://emotion.sh/docs/typescript#define-a-theme
And I noticed that once I reexport my own typed module for Emotion, the macro stops working (even though I do export the babel macro). When I inspect my elements, I don't see the readable class names.
To reproduce:
Here is a detailed CodeSandbox.
https://codesandbox.io/s/interesting-dawn-0hmtk?file=/src/App.tsx
Expected behavior:
Both buttons should have the properly named class.
Environment information:
react version: 16.13.0emotion version: 10.0.27I am not familiar with Babel macros... It might be inherent to the usage of a macro and might have no solution, but I think this should be documented.
There might be a workaround with re-typing @emotion/styled/macro through Typescript directly, without re-exporting it in a new module :thinking:
I recommend migrating to Emotion 11 and using this way of defining a global theme: https://deploy-preview-1600--emotion.netlify.app/docs/typescript#define-a-theme
Indeed, that will solve the issue! Thank you for the super quick answer.
Should we close this one since it won't be a problem anymore?
Yes, going to close this as its solved in v11 and we do not plan any changes tegarding that in v10