I want to make hover effect with increase of icon size, icons are from react icons, I'm using styled components. How should I do it ?
export const BottomBar = () => {
const style = { fontSize: "180%" };
return (
<StyledBottomBar>
<StyledIcon>
<FaFacebookSquare style={style} />
</StyledIcon>
<StyledIcon>
<GrInstagram style={style} />
</StyledIcon>
<StyledIcon>
<CgMail style={style} />
</StyledIcon>
<StyledIcon>
<BiPhoneCall style={style} />
</StyledIcon>
</StyledBottomBar>
);
};
Thanks !!!
It's not possible to do inline style's actions like
:hover
. You could use JS approachonMouseEnter
andonMouseLeave
:Or you could divide them into Component
<StyledIcon/>
and thenuseRef
,useEffect
anduseState
to do the hover.