Concepts category
React concepts.
Using GSAP inside React safely - the useGSAP hook, cleanup, and context.
gsap.context()gsap.context() is a GSAP method that collects every animation, timeline, and ScrollTrigger created inside a function so one
revert() call cleans them all up at once.useGSAPuseGSAP is the official React hook from @gsap/react that scopes GSAP animations to a component and cleans them up automatically on unmount.