小编Jon*_*rie的帖子

在 Emotion 11/Next js 10 应用程序中启用 css 属性的正确方法是什么

css道具在构建时无法识别。我不确定这是否是由于项目配置错误造成的,或者这是否代表一个已知的错误。

类型 '{ Children: (string | number | boolean | {} | ReactElement<any, string | ((props: any) => ReactElement<any, string | ... | (new (props: any) => Component<任何,任何,任何>)>) | (new (props: any) => Component<...>)> | ReactNodeArray | ReactPortal | Element)[]; 类名:字符串;css:序列化样式;}' 不可分配给类型 'IntrinsicAttributes & { theme?: Theme; 作为?:元素类型;} & ClassAttributes & HTMLAttributes<...> & { ...; }'。类型“IntrinsicAttributes & { theme?: Theme;”上不存在属性“css” 作为?:元素类型;} & ClassAttributes & HTMLAttributes<...> & { ...; }'

重现:

https://github.com/jbcurrie/jbcurrie.github.io/tree/next

  1. npm 安装
  2. 打开NavMenu.tsx
  3. 检查18号线

预期行为:

该 …

emotion typescript reactjs next.js

9
推荐指数
1
解决办法
1万
查看次数

标签 统计

emotion ×1

next.js ×1

reactjs ×1

typescript ×1