In my React TypeScript project, I've upgraded antd components from version 5.1 to 5.5 and now seeing a compile-time error:
Property 'rev' is missing in type '{}' but required in type 'Pick<AntdIconProps, "value" | "onChange" | "color" | "content" | "height" | "rotate" | "translate" | "width" | "start" | "hidden" | "cite" | "data" | "form" |
"label" | ... 349 more ... | "twoToneColor">'.
25 | return (
26 | <div>
> 27 | <ReloadOutlined />
| ^^^^^^^^^^^^^^
28 | </div>
29 | );
It seems that in the new version of antd, the Icon component has a new required property called "rev". so now every place in my code I have to provide a value for this prop! I am curious why this happens in this specific project (other projects and of course antd samples don't have this issue) and if anyone faced it
26 | <div>
> 27 | <ReloadOutlined rev={undefined}/>
28 | </div>
update react type package to fix your issues
npm i -D @types/react@latest
npm i -D @types/react-dom@latest
I have a same problem. When I upgrade the antd version 5.1.0 to 5.4.5. @ant-design/icon have "rev" props right now.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With