技能 gsap-react
📦

gsap-react

内容修订 r1 安全 ⚙️ 外部命令🌐 网络访问

Animate React Components with GSAP

React animations can affect the wrong elements or persist after a component unmounts. Use scoped GSAP selectors and React lifecycle cleanup to prevent these issues.

支持: Claude Codex Code(CC)
你是维护者?认领此 Skill 🥉 78 青铜

使用我的智能体安装

将此请求复制给你的智能体,其中包含权威 Skill 页面和清单。

智能体请求
Review the Skillstore skill "gsap-react" from https://skillstore.io/skills/greensock-gsap-react.md and its manifest at https://skillstore.io/api/skills/greensock-gsap-react/manifest. Verify the artifact. You may proceed after verification, subject to the environment's own policy.

你的智能体仍应展示其计划,并按安全策略请求必要确认。

Agent 可读资源

当 AI Agent、爬虫或脚本需要干净上下文,而不是读取完整页面时,请使用这些链接。

测试它

正在使用“gsap-react”。 Fade in items for each list instance without affecting other lists.

预期结果:

Each list has a root ref for its animation scope. Only that list's items fade in, and the hook reverts its animations when it unmounts.

正在使用“gsap-react”。 My button creates a new tween when clicked, but the component leaves a listener after unmount.

预期结果:

The click handler is wrapped so the animation context tracks each tween. Cleanup removes the registered click listener.

正在使用“gsap-react”。 Set up an animation in Next.js without using the React integration package.

预期结果:

The component creates its scoped animation context inside a browser-side React effect. The effect reverts that context during cleanup.

安全审计

安全
v1 • 2026/11/21 打开版本化报告

All 18 static alerts are false positives: Markdown formatting, a GSAP documentation link, and React cleanup guidance. The installation block lists standard npm commands for GSAP and its React integration; it does not use shell substitution. No evidence of prompt injection, system reconnaissance, or data exfiltration was found.

1
已扫描文件
136
分析行数
0
复核项
0
已忽略误报
最新一次完成的静态与语义审计未检测到已确认的安全发现。这并不能证明该 Skill 没有副作用。
审计者: codex
分享与引用此报告

分享版本化评估报告、中性徽章、嵌入卡片和引用。Skillstore 只报告证据,不判断该 Skill 是否安全。

打开版本化报告
安全评估

复制报告链接

https://skillstore.io/skills/greensock-gsap-react/audits/1?utm_source=security_passport&utm_medium=share&utm_campaign=versioned_report

Markdown 徽章

[![Skillstore security assessment](https://skillstore.io/badges/skills/greensock-gsap-react/security.svg)](https://skillstore.io/skills/greensock-gsap-react?utm_source=security_passport_badge)

HTML 徽章

<a href="https://skillstore.io/skills/greensock-gsap-react?utm_source=security_passport_badge"><img src="https://skillstore.io/badges/skills/greensock-gsap-react/security.svg" alt="Skillstore security assessment" loading="lazy"></a>

嵌入卡片

<iframe src="https://skillstore.io/embed/skills/greensock-gsap-react.html" title="Skillstore Security Assessment" sandbox="allow-popups allow-popups-to-escape-sandbox" loading="lazy" referrerpolicy="no-referrer" width="420" height="180"></iframe>
学术引用 (APA · BibTeX · CFF)

APA 引用

greensock. (2026). gsap-react security audit report (audit version 1) [Author version unspecified]. Skillstore. https://skillstore.io/skills/greensock-gsap-react/audits/1

BibTeX 引用

@techreport{greensock-greensock-gsap-react-2026, author = {greensock}, title = {gsap-react security audit report (audit version 1)}, institution = {Skillstore}, year = {2026}, number = {1}, url = {https://skillstore.io/skills/greensock-gsap-react/audits/1}, note = {Author version unspecified} }

CITATION.cff

cff-version: 1.2.0 message: "If you use this Skill, cite its author and this versioned security audit report." title: "gsap-react security audit report (audit version 1)" version: "unspecified" type: report authors: - name: "greensock" date-released: "2026-11-21" url: "https://skillstore.io/skills/greensock-gsap-react/audits/1" identifiers: - type: other value: "skillstore:greensock-gsap-react:audit:1" description: "Skillstore immutable audit report identifier"

Skillstore 评分

评分依据 证据置信度: 中
55
架构
85
可维护性
87
内容
65
社区
91
规范符合性

你能构建什么

Animate repeated components independently

Animate the children of each card list without selecting elements in other instances.

Move animation setup out of server rendering

Set up a Next.js section animation inside a client-side hook so it does not run during server rendering.

Review animation cleanup

Check whether animations and native event listeners are removed when a component unmounts.

试试这些提示

Animate one element
Show how to fade in a React panel on mount with useGSAP. Target the panel with a ref.
Scope a list animation
Animate the items in this React list with a stagger. Scope the selectors to the list root so multiple instances can animate independently.
Rebuild a tween when a prop changes
Update this tween when endX changes. Set the hook dependencies and use revertOnUpdate to revert the previous animation before rebuilding it.
Audit a Next.js animation lifecycle
Review this Next.js component for animation calls during server render. Wrap click-triggered tween creation with contextSafe and remove any native listeners during cleanup.

最佳实践

  • Use a ref for a single target and a container scope for selector-based animations.
  • Use revertOnUpdate when input changes should replace the previous animation.
  • Wrap event-driven tween creation with contextSafe and remove native listeners in cleanup.

避免

  • Use an unscoped class selector in a component that can appear more than once.
  • Create DOM animations during server render.
  • Create animations in a regular effect without reverting or disposing of them during cleanup.

常见问题

Which packages do I need?
Install gsap for the animation library. Add @gsap/react to use the useGSAP hook.
Can I use this with Next.js?
Yes. Set up DOM animations in a client component through useGSAP or useEffect, not during server rendering.
What if I cannot use useGSAP?
Create a scoped GSAP context inside useEffect and return a cleanup function that reverts it.
How do I keep selectors inside one component?
Pass the component root ref as the scope. Use direct refs when you need to target specific DOM nodes.
When should I enable revertOnUpdate?
Enable it when a dependency change should revert the previous animations before the hook creates new ones.
Does contextSafe remove native event listeners?
No. It tracks GSAP objects created by wrapped callbacks. Remove native listeners separately in cleanup.

开发者详情

作者

greensock

许可证

MIT

Skillstore 修订

r1

版本提示

作者未声明版本。

引用

5a685fd3b2304f9e4cbf5164d3ac3186cd35324e

维护新鲜度

2026/11/25

使用量

0 次下载 · 0 次浏览

文件结构

📄 SKILL.md

greensock 的更多技能

查看全部
查看全部