Share Posted September 12, 2020 Hello! I am running an React app (CRA) with GSAP. I am still fairly new to React so I dont know the ins and out of React. I have a question about refreshing/re-running gsap animation after coming back to a page. So for example, If i am on the homepage and go through the page the animations works perfectly. However, If i navigate to another page and then come back to the Homepage either through the back-button or just through nav link, all the animations are gone and pictures and text are gone. I have used tl.kill() which solved the animation marker/content carrying over to different pages problem (although I dont think tl.kill() is the right approach.) I have used tl.refresh and then tl.enabled inside my useEffects() hooks to reinitialize the animations but that didnt work either. I have attached a code sandbox of a simplified version of my code to give you guys a better idea. I would really appreciate from you guys! Thank you in advance! This is my codesandbox: https://codesandbox.io/s/page-transition-omgpq?file=/src/App.js See the Pen App.js by s (@s) on CodePen Link to comment Share on other sites More sharing options...
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
Already have an account? Sign in here.Sign In Now