我在这里有一个代码:https://codesandbox.io/s/agitated-boyd-9z2r9?file=/pages/index.tsx
我在使用组件选择器时遇到了问题,例如,如果我使用@mui/material中的styled,我会得到这个错误Error: Component selectors can only be used in conjunction with @emotion/babel-plugin。但是如果我使用@emotion/styled中的styled,它工作得很好。
还有一个已经关闭的相关问题:https://github.com/mui-org/material-ui/issues/27380没有关于如何重新打开它的线索。
发布于 2021-09-28 08:30:47
您需要安装@emotion/babel-plugin并对其进行配置,以处理来自@mui/material的导入。请参阅https://github.com/mui-org/material-ui/issues/27380#issuecomment-928973157
https://stackoverflow.com/questions/69351350
复制相似问题