gsap-react

Integrate GSAP animations into React components using the useGSAP() hook.

Updated Apr 21, 2026
One-click install
npx skills add https://github.com/LuXDAmore/experiments --skill gsap-react-luxdamore
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gsap-react
Source: https://github.com/LuXDAmore/experiments/tree/main/.continue/skills/gsap-react
Command: npx skills add https://github.com/LuXDAmore/experiments --skill gsap-react-luxdamore

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @gsap/react, gsap, and includes scripts (resource) components.

What problem does it solve?

This Skill provides a streamlined way to incorporate GSAP animations into React applications, addressing the challenges of animation setup, cleanup, and context management in React components.

Core Features & Use Cases

  • useGSAP() Hook: Simplifies GSAP animation setup and cleanup within React components.
  • Context Management: Offers a GSAP context that manages animation states and cleans up on component unmount.
  • Compatibility: Ensures GSAP animations work seamlessly with React and Next.js frameworks.
  • Use Case: Ideal for React developers who want to add engaging animations to their web applications without the complexities of manual GSAP setup.

Quick Start

To animate an element with GSAP in a React component, first install GSAP and @gsap/react. Then, use the useGSAP() hook to define and manage your animations.

Frequently Asked Questions about gsap-react

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I use GSAP animations in React without breaking component state?

Using the useGSAP() hook provides a dedicated GSAP context for React components, ensuring animations integrate seamlessly without breaking component state or causing memory leaks on unmount.

What is the best way to clean up GSAP animations when a React component unmounts?

The useGSAP() hook handles automatic cleanup for GSAP animations through built-in context management, reverting animations and destroying instances safely when the React component unmounts.

Can I use GSAP with Next.js and React server components?

Yes, this integration ensures GSAP animations work seamlessly with both React and Next.js frameworks, handling context management specifically for React-based component architectures.

Do I need to manually configure GSAP context for React hooks?

No, the useGSAP() hook simplifies setup by automatically managing the GSAP context, allowing you to define animations directly inside the hook without manual context configuration.

Why does my GSAP animation break when React re-renders the component?

Standard GSAP animations break on React re-renders because they lack component lifecycle awareness; useGSAP() solves this by scoping animations to a managed context that respects React renders.

Are there limitations to using GSAP in React compared to vanilla JavaScript?

GSAP in React requires strict context management to avoid memory leaks from unmounted components, whereas the useGSAP() hook abstracts this limitation by handling scope and cleanup automatically.