Why Reanimated?
React Native Skia integrates with Reanimated 3 for animations because:- Zero bridge overhead - Animations run entirely on the UI thread
- 60+ FPS performance - Smooth animations without dropping frames
- Declarative API - Easy to use and understand
- Shared values - Reactive state that updates the canvas automatically
- Gesture integration - Works seamlessly with React Native Gesture Handler
Basic Animation Example
Shared Values
Shared values are the foundation of Reanimated animations. They can be used directly in Skia components:Animation Types
Timing Animation
Animate to a target value over time:Spring Animation
Physics-based spring animation:Decay Animation
Gradually slow down (great for gestures):Repeat Animation
Repeat animations indefinitely or a set number of times:Sequence Animation
Chain animations together:Derived Values
Compute values based on other shared values:Interpolation
Map values from one range to another:Color Interpolation
Transform Animations
Path Interpolation
Interpolate between paths:Performance Tips
Use worklets
Mark functions that run on the UI thread with'worklet':
Minimize re-renders
Shared values don’t trigger re-renders. Use them for high-frequency updates:Batch updates
Update multiple values in a single animation:requestAnimationFrame
For custom animation loops:Common Animation Patterns
Fade In
Pulse Effect
Rotate Continuously
Bounce In
Animation State
Cancel animations programmatically:Related
- Reanimated Integration - Deep dive into Reanimated
- Gestures - Gesture-driven animations
- Hooks - Animation hooks and utilities
- Textures - Animate React components as textures