Basic Concept
Use Reanimated’suseSharedValue and animation functions with Skia components. The values update on the UI thread for smooth 60fps+ animations.
Shared Values
useSharedValue
Create a value that can be animated on the UI thread:Setting Values
Animation Functions
withTiming
Animate to a value over time:withSpring
Animate with spring physics:withRepeat
Repeat an animation:withSequence
Chain animations:withDecay
Animate with decay (deceleration):Derived Values
useDerivedValue
Compute values based on other shared values:Gestures
Combine with Reanimated gestures:Using onSize
Get canvas dimensions reactively:Worklet Functions
Use worklet functions for complex animations:Examples
Fade In Animation
Continuous Rotation
Bouncing Animation
Interactive Scale
Performance Tips
- All animations run on the UI thread - no bridge crossing
- Use worklet functions for complex calculations
- Avoid using JavaScript values inside worklets
- Mark functions with
"worklet"directive when needed - Use
useDerivedValuefor computed values - Batch updates when animating multiple values