vercel-react-native-skills
React Native and Expo best practices for building performant mobile apps. Use when building React Native components, optimizing list performance, implementing animations, or working with native modules. Triggers on tasks involving React Native, Expo, mobile performance, or native platform APIs.
Install
npx skills add https://github.com/vercel-labs/agent-skills --skill vercel-react-native-skills- title
- Use GestureDetector for Animated Press States
- impact
- MEDIUM
- impactDescription
- UI thread animations, smoother press feedback
- tags
- animation, gestures, press, reanimated
Use GestureDetector for Animated Press States
For animated press states (scale, opacity on press), use GestureDetector with
Gesture.Tap() and shared values instead of Pressable's
onPressIn/onPressOut. Gesture callbacks run on the UI thread as worklets—no
JS thread round-trip for press animations.
Incorrect (Pressable with JS thread callbacks):
Correct (GestureDetector with UI thread worklets):
Store the press state (0 or 1), then derive the scale via interpolate.
This keeps the shared value as ground truth. Use runOnJS to call JS functions
from worklets. Use .set() and .get() for React Compiler compatibility.
Reference: Gesture Handler Tap Gesture