gsap-react

Guide GSAP animation integration in React with hooks and refs.

Updated Jun 2, 2026
One-click install
npx skills add https://github.com/yyykkkun/TYUT- --skill gsap-react-yyykkkun
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gsap-react
Source: https://github.com/yyykkkun/TYUT-/tree/main/frontend/.agents/skills/gsap-react
Command: npx skills add https://github.com/yyykkkun/TYUT- --skill gsap-react-yyykkkun

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill provides React developers with a comprehensive guide on using GSAP for animations, simplifying the process of integrating GSAP animations into React applications.

Core Features & Use Cases

  • Animation Guidance: Offers best practices for GSAP with React, including hooks, refs, and context management.
  • Animation Patterns: Demonstrates the use of useGSAP() for deterministic tasks and animation cleanup.
  • Use Case: When you're building a React app that requires complex animations, this Skill outlines the correct implementation and usage of GSAP with React.

Quick Start

Implement GSAP animations in your React component by following the guidelines outlined in the 'GSAP with React' section.

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 running into cleanup issues?

GSAP animations in React require proper cleanup to avoid memory leaks. This Skill provides guidelines for using the `useGSAP()` hook to manage animation contexts safely, ensuring deterministic task execution and automatic cleanup when components unmount.

What is the best way to manage GSAP refs and context in React components?

The best way to manage GSAP refs and context in React is by using the `@gsap/react` library. This Skill outlines best practices for hook usage, ref management, and context safety to create complex animations without conflicting with React's lifecycle.

Do I need to install @gsap/react to build complex animations in a React application?

Yes, building complex GSAP animations in React requires installing both `gsap` and `@gsap/react`. These dependencies provide the necessary hooks and context management tools to integrate animations safely within React's rendering lifecycle.

How does useGSAP handle animation cleanup compared to useEffect?

The `useGSAP` hook handles animation cleanup by automatically reverting animations and killing tweens when the component unmounts. It simplifies context management compared to manual `useEffect` cleanup, preventing animation conflicts and memory leaks.

Can I create deterministic animation tasks using GSAP with React hooks?

Yes, you can create deterministic animation tasks using GSAP with React hooks. This Skill demonstrates how to use `useGSAP()` for deterministic task execution, ensuring animations run predictably and are properly cleaned up within the React component tree.

When should I use GSAP for React animations instead of other animation libraries?

You should use GSAP for React animations when building applications that require complex, timeline-based animations. This Skill provides the implementation guidelines needed to leverage GSAP's advanced animation capabilities safely within React's component architecture.