greensock/gsap-react
React integration with useGSAP hook, refs, gsap.context(), cleanup, and SSR
Open source
Description
gsap-react is an agent skill from the GSAP project that covers GSAP animation setup in React and Next.js. It uses the useGSAP hook, gsap.context() and ref-based targeting, and it handles cleanup on unmount, scoped selectors, context-safe callbacks and server-side rendering safety. The page says it also works with the wider GSAP ecosystem, including ScrollTrigger and timelines. Using useGSAP instead of a raw useEffect removes the need for manual ctx.revert() calls and prevents the animation leaks and stale-node warnings that come from skipping cleanup. Example jobs from the page are animating components on mount with automatic cleanup when they unmount, scoping GSAP selectors to a single component so they do not match DOM outside it, wrapping click handlers in contextSafe so animations stop firing after unmount, running GSAP animations in Next.js without errors during server render, and managing timeline cleanup across re-renders with revertOnUpdate. It is aimed at React and Next.js developers who already use GSAP. Install it with npx skills add https://github.com/greensock/gsap-skills --skill gsap-react. It is published in the greensock gsap-skills repository on GitHub.…
Highlights
- useGSAP hook for React and Next.js
- Automatic cleanup on unmount
- Scoped selectors and ref-based targeting
- contextSafe for click handlers
- SSR-safe setup
Ratings & Reviews
No ratings yet
Be the first to rate greensock/gsap-react.
People also visit
greensock/gsap-react FAQ
What does gsap-react cover?
GSAP setup in React and Next.js using the useGSAP hook, gsap.context() and refs.
How do I install it?
Run npx skills add https://github.com/greensock/gsap-skills --skill gsap-react.
Why use useGSAP instead of useEffect?
The page says it removes manual ctx.revert() calls and prevents animation leaks and stale-node warnings.
Does it work with Next.js server rendering?
The page says it covers SSR safety so animations do not error during server render.
Who publishes it?
The GSAP project, in its gsap-skills repository on GitHub. The page lists the skill as community.
What are the best greensock/gsap-react alternatives?
Popular alternatives to greensock/gsap-react include gsap-react, gsap-react and gsap-skills (repo). See all greensock/gsap-react alternatives










