Gsap .from doesnt work with useEffect[]
Im learning now GSAP, so I think it's a really simple question, anyway, the documentation says this:
Whenever I refresh the site, it happens what you see in the GIF https://i.imgur.com/JrVzB11.gif, the animation "glitches", why? I tried to make the animation start when I click the div and it works fine, it start 200px off and then gets in the right position (but it glitches if you click it before the animation ends https://i.imgur.com/owuOWU7.gif, here I first make it end, then I click quickly)
7 Replies
Have you read through this? https://greensock.com/react-advanced/
There is another started guide for gsap in react but I can't find it atm
cause I'm blind lol https://greensock.com/react/
Thank you, no I didnt read it
I'll read it later, and I'll see if I can fix my problem. Thanks again @b1mind
I can't remember whether it's an issue with just
fromTo
or from
as well, but have you tried immediateRender: false
? https://greensock.com/immediaterender/
9 times out of 10 that's the issue when I've got glitching animationsGreenSock
immediateRender demystified
The immediateRender property of from() and fromTo() tweens is one of those things you only find out about when it gives you unexpected results. from() and fromTo() tweens are special as they set immediateRender to true as soon as they are created. This helps especially when creating staggered bui...
*there you go in the description, it's
from
as well.@b1mind Thank you, i read the documentation and now im able to make most of my things work, although there are a few problems:
I think Im using the useLayoutEffect correctly, but it's giving me this error:
And also, it cant found
.singleLetter
, any suggestion?I don't use React
Creates overcomplicated problems specially when working with a lib that's meant to work with the real Dom.
Ok
Thanks anyway