2

I'm trying to animate an circle in an svg along a path using react-spring but im not sure how to go about it.

I know I need the ref on the path so I can get the total length of the path and then use getPointAtLength to get the x and y to move the circle along it but I cant seem to figure out how to do this in react-spring

Heres a codesandbox of where im at so far

https://codesandbox.io/s/unruffled-mclean-0jznxi?file=/src/App.js

matt
  • 21
  • 2
  • 1
    Your example has syntax errors, not sure what this has to do with react-spring specifically but if you want to do it with SMIL directly in the svg there's [animateMotion](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/animateMotion) element that's pretty straight forward. – Chris W. Apr 22 '22 at 21:30

0 Answers0