Using framer motion I want to animate my Icon component to rotate 90 degrees when hovering at the parent element which is a button.
<motion.button type="button" whileHover={{scale: 1.1}}>
Visit our Industry
{/*Animate this Icon to rotate 90 degrees*/}
<Icon type="arrow-up" />
</motion.button>
I saw the use of variants but not sure how to really use them with props like whileHover
.
Any help will be appreciated since this is a new thing.
You need to set 'whileHover' to a string and use the varients to animate.