How to use GSAP ScrollTrigger in React without causing memory leaks or janky animations.
GSAP is powerful but doesn't automatically clean up in React. Here's how to avoid common pitfalls.
ScrollTrigger instances persist even after components unmount. Without cleanup, you'll have dozens of zombie triggers eating memory.
gsap.context() is your friend. It scopes all animations and ScrollTriggers, making cleanup a single call.