-
Posts
45 -
Joined
-
Last visited
Community Answers
-
BrianCross's post in Next.js with GSAP - ScrollTrigger was marked as the answer
Not sure if this is causing your exact error but you need to put this:
const tl = gsap.timeline({ // yes, we can add it to an entire timeline! scrollTrigger: { trigger: triggerRef.current, start: 'top center', toggleActions: 'play none none reverse', markers: true, }, }); in your useEffect callback. Otherwise the timeline instance will get re-created every time the component re-renders.