Jump to content
Search Community

Can't make convertCoordinates() work on React

Drymy test
Moderator Tag

Go to solution Solved by OSUblake,

Recommended Posts

Hello!

I'm trying to use convertCoordinates from the MotionPathPlugin but sadly i can't manage to make it work despite my tries.

I cannot make a CodePen but i made a CodeSandbox rather here :

https://codesandbox.io/s/solitary-morning-0v5l8?file=/src/App.js

 

The goal was to move the green bloc to the blue bloc by giving it its coordinates. If i input a manual value on x such as 300 then the green bloc moves but using convertCoordinates never works whatever i try. My best guess was a weird interaction with useRef or useEffect since i can't use variables like in the documentation, but i don't know how to solve it..

 

Any ideas please? Thank you!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...