I have a function type react component:
function Card(props, {icon}) {
return (
<div className="card">
<FontAwesomeIcon icon={icon} className="icon"/>
<h3 className="text">{props.name}</h3>
</div>
)
}
and I want to have 2 attributes for it: name and icon
But to display the name in my title I need to use the props.name but the icon is just an attribute. When I pass the arguments like that I only get the name, and if I only pass the icon, I'm able to get the icon, but I can't manage to have them both. (The icon is a Fontawesome component).
I'm calling it in my App.js like this:
<Card name="Folder" icon="folder"/>
How can I make this work?