framer / motion

Open source, production-ready animation and gesture library for React
https://framer.com/motion
MIT License
22.27k stars 733 forks source link

Binding `stop()` to animation #2635

Closed mattgperry closed 4 weeks ago

mattgperry commented 4 weeks ago

This PR binds stop to the animation to fix a pattern where animation.stop is passed back from useEffect.

useEffect(() => {
  const animation = animate()
  return animation.stop
})