What I would like to do but isn't possible is something like this:
import { FaBook } from 'react-icons/fa';
const Parent = () => <Child icon={FaBook}>Save</Child>;
Then in the child
const Child = ({ icon }) => (
<div>
<Icon as={icon} size={20} />
<Icon as={icon} size={30} />
</div>
);
This is so I don't have to pass an iconSmall
and iconLarge
prop separately the size is the only differentiator. I there a react way I can add the size
property on the child?