Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问许可证需确认审计提醒

animating-react-native-expoanimating React native expo 搜索

Agent Skill

用于辅助前端页面、组件、样式和交互逻辑的开发与维护。它适合让 Agent 生成或审查 React、Next.js、Vue、Tailwind、CSS 等相关代码,整理组件结构,或定位布局和性能问题。使用时需要结合项目现有设计系统、路由和构建方式,避免只生成孤立片段;涉及页面改动时,应配合本地预览和构建检查确认视觉效果。

总安装

4,493

周安装

180

GitHub Stars

公开资料未说明

下载量

1,454
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:animating-react-native-expo(animating React native expo 搜索)
来源仓库:https://github.com/tristanmanchester/agent-skills
仓库路径:skills/animating-react-native-expo
安装命令:
npx skills add https://github.com/tristanmanchester/agent-skills --skill animating-react-native-expo
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/tristanmanchester/agent-skills --skill animating-react-native-expo

简介

animating-react-native-expo 提供 Reanimated v4 与 Gesture Handler 的最佳实践指南,助力高性能移动端动画开发。

  • 适用于需要实现手势驱动、物理模拟或复杂交互的 React Native(Expo)应用。
  • 推荐优先使用共享值与 worklet 在主线程运行计算密集型任务,保障 60fps 流畅体验。
  • 部署前应在真机或模拟器测试动画性能,特别注意内存占用与热重载对动画状态的影响。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

React Native (Expo) animations — Reanimated v4 + Gesture Handler

Defaults (pick these unless there’s a reason not to)

  1. Simple state change (hover/pressed/toggled, small style changes): use Reanimated CSS Transitions.
  2. Mount/unmount + layout changes (lists, accordions, reflow): use Reanimated Layout Animations.
  3. Interactive / per-frame (gestures, scroll, physics, drag): use Shared Values + worklets (UI thread).

If an existing codebase already uses a different pattern, stay consistent and only migrate when necessary.

Quick start

Install (Expo)

npx expo install react-native-reanimated react-native-worklets react-native-gesture-handler

Run the setup check (optional):

node {baseDir}/scripts/check-setup.mjs

1) Shared value + withTiming

import { Pressable } from 'react-native';
import Animated, { useSharedValue, useAnimatedStyle, withTiming } from 'react-native-reanimated';

export function FadeInBox() {
  const opacity = useSharedValue(0);

  const style = useAnimatedStyle(() => ({ opacity: opacity.value }));

  return (
    <Pressable onPress={() => (opacity.value = withTiming(opacity.value ? 0 : 1, { duration: 200 }))}>
      <Animated.View style={[{ width: 80, height: 80 }, style]} />
    </Pressable>
  );
}

2) Pan gesture driving translation (UI thread)

import Animated, { useSharedValue, useAnimatedStyle, withSpring } from 'react-native-reanimated';
import { GestureDetector, usePanGesture } from 'react-native-gesture-handler';

export function Draggable() {
  const x = useSharedValue(0);
  const y = useSharedValue(0);

  const pan = usePanGesture({
    onUpdate: (e) => {
      x.value = e.translationX;
      y.value = e.translationY;
    },
    onDeactivate: () => {
      x.value = withSpring(0);
      y.value = withSpring(0);
    },
  });

  const style = useAnimatedStyle(() => ({ transform: [{ translateX: x.value }, { translateY: y.value }] }));

  return (
    <GestureDetector gesture={pan}>
      <Animated.View style={[{ width: 100, height: 100 }, style]} />
    </GestureDetector>
  );
}

3) CSS-style transition (best for “style changes when state changes”)

import Animated from 'react-native-reanimated';

export function ExpandingCard({ expanded }: { expanded: boolean }) {
  return (
    <Animated.View
      style={{
        width: expanded ? 260 : 180,
        transitionProperty: 'width',
        transitionDuration: 220,
      }}
    />
  );
}

Workflow (copy this and tick it off)

  • Identify the driver: state, layout, gesture, or scroll.
  • Choose the primitive:

- state → CSS transition / CSS animation - layout/mount → entering/exiting/layout transitions - gesture/scroll → shared values + worklets

  • Keep per-frame work on the UI thread (worklets); avoid React state updates every frame.
  • If a JS-side effect is required (navigation, analytics, state set), call it via scheduleOnRN.
  • Verify on-device (Hermes inspector), not “Remote JS Debugging”.

Core patterns

Shared values are the “wire format” between runtimes

  • Use useSharedValue for numbers/strings/objects that must be read/written from both UI and JS.
  • Derive styles with useAnimatedStyle.
  • Prefer withTiming for UI tweens; withSpring for physics.

UI thread vs JS thread: the only rule that matters

  • Gesture callbacks and animated styles should stay workletized (UI runtime).
  • Only bridge to JS when you must (via scheduleOnRN).

See: references/worklets-and-threading.md

Gesture Handler: use one API style per subtree

  • Default to hook API (usePanGesture, useTapGesture, etc.).
  • Do not nest GestureDetectors that use different API styles (hook vs builder).
  • Do not reuse the same gesture instance across multiple detectors.

See: references/gestures.md

CSS Transitions (Reanimated 4)

Use when a style value changes due to React state/props and you just want it to animate.

Rules of thumb:

  • Always set transitionProperty + transitionDuration.
  • Avoid transitionProperty: 'all' (perf + surprise animations).
  • Discrete properties (e.g. flexDirection) won’t transition smoothly; use Layout Animations instead.

See: references/css-transitions-and-animations.md

Layout animations

Use when elements enter/exit, or when layout changes due to conditional rendering/reflow.

Prefer presets first (entering/exiting, keyframes, layout transitions). Only reach for fully custom layout animations when presets can’t express the motion.

See: references/layout-animations.md

Scroll-linked animations

Prefer Reanimated scroll handlers/shared values; keep worklet bodies tiny. For full recipes, see:

Troubleshooting checklist

  1. “Failed to create a worklet” / worklet not running
  • Ensure the correct Babel plugin is configured for your environment.

- Expo: handled by babel-preset-expo when installed via expo install. - Bare RN: Reanimated 4 uses react-native-worklets/plugin.

  1. Gesture callbacks not firing / weird conflicts
  • Ensure the app root is wrapped with GestureHandlerRootView.
  • Don’t reuse gestures across detectors; don’t mix hook and builder API in nested detectors.
  1. Needing to call JS from a worklet
  • Use scheduleOnRN(fn,...args).
  • fn must be defined in JS scope (component body or module scope), not created inside a worklet.
  1. Jank / dropped frames
  • Check for large objects captured into worklets; capture primitives instead.
  • Avoid transitionProperty: 'all'.
  • Don’t set React state every frame.

See: references/debugging-and-performance.md

Bundled references (open only when needed)

Quick search

grep -Rni "scheduleOnRN" {baseDir}/references
grep -Rni "transitionProperty" {baseDir}/references
grep -Rni "usePanGesture" {baseDir}/references

Primary docs

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

38.99%
按下载量换算567

Claude

28.89%
按下载量换算420

Cursor

17.8%
按下载量换算259

Gemini CLI

10.41%
按下载量换算151

安全审计

Gen Agent Trust Hub

可疑

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills