Jump to content
Search Community

SVG line rotation in react

DiegoM test
Moderator Tag

Recommended Posts

Hey Diego. I'm not a React guy so I could be wrong here but I think the issue is that in your component the attributes are going to update immediately because you set them:

x1={centerX}
y1={centerY}
x2={centerX + length}
y2={centerY}

So when you update the centerX and Y it will be set immediately (then GSAP will try to animate to the same value). 

 

FYI smoothOrigin is true by default so you don't need to import CSSPlugin or change the value.

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...