bitworking / react-gsap

React components for GSAP
https://bitworking.github.io/react-gsap/
Other
571 stars 33 forks source link

React 18 and Tweens #69

Open paulieDOTjs opened 2 years ago

paulieDOTjs commented 2 years ago

From animations do not work anymore after updating to React 18.

adamalfredsson commented 2 years ago

Details here: https://greensock.com/forums/topic/31712-simple-opacity-fade-doesnt-work-in-react/#comment-158550

bitworking commented 2 years ago

Sorry, I was busy with other things the last months. Hmm, I just updated every package locally and tried it with React 18 and Strict Mode in the local Next.js. It runs without problems on my side. I have to do some other tests.

Does it work for you if you disable Strict Mode?

bitworking commented 2 years ago

Ok, I see it now. I first didn't saw that it's only not working for "from" animations. Will have a look at this, thank you.

bitworking commented 2 years ago

A quick fix would be to not use the Strict Mode: https://stackblitz.com/edit/react-ts-fmarqq?file=App.tsx

paulieDOTjs commented 2 years ago

Yes, that would be a quick fix, but there are instances where one would want to use Strict Mode