i'm new to styled-components and i want to use <IconContext.Provider> from react icons this is my react component:
<myComp>
<AiFillPlusCircle />
</myComp>
and this is my styled components code:
import { IconContext } from 'react-icons';
export const myComp= styled(IconContext.Provider)`
color: rgb(71, 71, 71) !important;
vertical-align: middle !important;
font-size: 1.7rem !important;
`;
but it doesn't work!
When you wrap some component with
styledhoc, it just passesclassNameprop to your component.IconContext.Providerexpects onlyvalueprop. This prop is object and can containstyle,attrorclassNamevalues. You can just passstyleattribute to configure it like this:However, if you would like to use styled-components, it could be possible like this: