react-gsap icon indicating copy to clipboard operation
react-gsap copied to clipboard

React 18 and Tweens

Open paulieDOTjs opened this issue 2 years ago • 5 comments

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

paulieDOTjs avatar Jul 13 '22 16:07 paulieDOTjs

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

adamalfredsson avatar Jul 31 '22 19:07 adamalfredsson

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 avatar Sep 16 '22 15:09 bitworking

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 avatar Sep 16 '22 15:09 bitworking

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

bitworking avatar Sep 16 '22 15:09 bitworking

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

paulieDOTjs avatar Sep 28 '22 20:09 paulieDOTjs