KidNinja Posted January 9, 2023 Posted January 9, 2023 I have this simple text animation. I was following a tutorial on youtube. The animation works as expected but after it is completed it seems to automatically hide itself. I have included a video below. Untitled.mp4
KidNinja Posted January 9, 2023 Author Posted January 9, 2023 https://zzozdp.csb.app/ - This is a link to it
Solution GreenSock Posted January 9, 2023 Solution Posted January 9, 2023 Welcome to the forums, @KidNinja It looks like you just aren't doing proper cleanup. In React 18, useEffect() is actually called TWICE. So you're inadvertently creating duplicate/competing animations. That's why gsap.context() is your new best friend in React - please read this article: It makes cleanup super easy. Is this what you were looking for?: https://codesandbox.io/s/silent-surf-gm3896?file=/src/App.js
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now