I am currently trying to use the Framer Motion library to move an object when clicking it. I want to be able to move a component to a specific location and it doesn’t matter where the start position is. I’m lost how to approach this problem.
Currently, I tried the animate()
function according to the documentation. But I only see how they move the component by directly changing x and y position such as animate(scope.current, {x:20, y:-20}
.
Any help would be appreciated.
cup is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.