kosmo Posted July 22, 2021 Share Posted July 22, 2021 On 6/8/2021 at 12:32 AM, jltech said: Something that helped me in Reactjs was to kill all the ScrollTriggers on a page when it dismounts. In the useEffect I have to create the ScrollTriggers I am doing this: useEffect(() => { ... ... return () => { // We kill all scroll triggers so the next pages can recreate them. const triggers = ScrollTrigger.getAll(); if (triggers) { triggers.forEach((trigger) => { trigger.kill(); }) } }; }, []); Hope this helps someone. Thanks for your help I was trying to destroy my animations after loading barbaJS Link to comment Share on other sites More sharing options...
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