Open saiichihashimoto opened 3 months ago
That will definitely be very useful. In fact, I would suggest that the onAnimationStart method should detect when the motion element has the delay prop. That's the actual moment when the animation should start.
Is your feature request related to a problem? Please describe. Sometimes, I want to use
onAnimationStart
for when the animation actually starts, including it's delay (including if it's a staggered child of it's parent, etc). Truly when it starts. Currently,onAnimationStart
is mostly a wrapper arounduseContext(MotionContext).animate
Describe the solution you'd like A callback for when an animation has actually begun in the DOM.
Describe alternatives you've considered Currently, I'm wrapping
motion.div
in my own component that uses asetTimeout
based on theanimate
andvariants[definition].transition.delay
it's given in props and hoping they correlate.