I created motion.div component, which contains initial, animate and whileTap properties:
<motion.button
initial={'initial'}
animate={'in'}
whileTap={'onTap'}
variants={introButtonVariants}
>...</>
in variation contains transition with the delay: 0.5:
in: {
x: 0,
scale: 1,
transition: { duration: 0.5, delay: 0.5 }
}
But this delay: 0.5 is affecting onTap variation, even if I explicitly specify new delay there. So on tap, it instantly goes in the "tapped" mode but then it stops for 0.5s. before backward animation.
onTap: {
scale: 0.8,
transition: { scale: { delay: 0 } }
}
How can the delay value, which goes to animate property, be overridden by the new one, which is defined in the new variation?