Open
Description
There's a bit of a blind spot in the API at the moment where if you take
<motion.div
initial={{ scale: 0 }}
animate={{ scale: 1, transition: { delay: 1 } }}
whileHover={{ scale: 2 }}
/>
For instance you can see that when we re-enter the animate
state there'll be a delay
applied. When really the delay
naturally applies to the initial animation.
It'd be good if we could figure out a way to define a transition that applies just on the initial animation. Perhaps there's also value in being able to define specific transitions more generally, like whileHover
-> animate
?
<motion.div
initial={{ scale: 0 }}
animate={{ scale: 1, transition: { delay: 1 } }}
whileHover={{ scale: 2 }}
transition={{
initial -> animate: {},
whileHover -> animate: {}
}}
/>
Or
<motion.div
initial={{ scale: 0 }}
animate={{
scale: 1,
transitionFrom: {
initial: { delay: 1 },
whileHover: { type: "spring" }
}
}
whileHover={{
scale: 2
}}
/>