Typescript antd List component add style prompt that this type does not exist

the List component of

antd directly writes style= {{width: "300pxcards, marginRight:" 20px"}} , indicating that this attribute does not exist in List.
can only be solved by putting a div on the outer layer? Is there any other solution?

clipboard.png

May.06,2022

ts is a strongly typed language, and the interface of List's props does not define the style attribute, so you can't write style directly. It's easy to add a layer of div. Don't bother with these problems. The loss outweighs the gain.

Menu