umi引入@ant-design/icons typescript类型报错

颛孙正谊
2023-12-01

umi引入@ant-design/icons typescript类型报错

例如:

 import { SearchOutlined } from '@ant-design/icons';
 <Button type="primary" shape="circle" icon={<SearchOutlined/>} />

解决方案:
把antd版本改成和@ant-design/icons保持一致
package.json

 "@ant-design/icons": "^4.7.0",
  "antd": "^3.19.5",

把 3.19.5改为4.7.0 ,重启搞定。

 类似资料: