Optional onOptional onCallback when animation defined in animate begins.
The provided callback will be called with the triggering animation definition. If this is a variant, it'll be the variant name, and if a target object then it'll be the target object.
This way, it's possible to figure out which animation has started.
function onStart() {
console.log("Animation started")
}
<motion.div animate={{ x: 100 }} onAnimationStart={onStart} />
Optional onCallback with latest motion values, fired max once per frame.
function onUpdate(latest) {
console.log(latest.x, latest.opacity)
}
<motion.div animate={{ x: 100, opacity: 0 }} onUpdate={onUpdate} />
Generated using TypeDoc
Callback when animation defined in
animateis complete.The provided callback will be called with the triggering animation definition. If this is a variant, it'll be the variant name, and if a target object then it'll be the target object.
This way, it's possible to figure out which animation has completed.