I'm using in my project library react-icons
to provide some standard icons (mostly Material Design ones).
Sometimes I need to pass an icon to a compoment and then override some properties, for instance (pseudocode):
type MyComponentProps = {
icon: (?)
}
function MyComponent({ icon } : MyComponentProps) {
return (
<icon size={20} className="inline-block" />
)
}
Is it possible? How should I declare the props type to make it possible?
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744127027a4559661.html
评论列表(0条)