Installation
-
Add the JavaScript library dependency in the package.json file:
-
Add the
@amazon-devices/react-native-reanimatedplugin to your babel.config.js: -
Run the following command to clear the Metro bundler cache:
-
Reinstall the package-lock.json file by running the
npm installcommand.
Examples
The following example shows how to run a simple animation in an infinite loop using thewithTiming method.
withSpring function:
API reference
The reanimated library on Vega provides a Turbo Module, which adds support for most of the following methods.Animations
Core
Scroll
Device
Threading
workletize
To convert a JavaScript function into a serializable object, which can be copied and ran over on UI thread. Functions are marked with “worklet”. Directives are automatically picked up and workletized by the Reanimated Babel plugin.Utilities
Advanced APIs
Known issues and limitations
The reanimated library on Vega has a few exceptions in terms of API support. Vega doesn’t support the following hooks and methods:useAnimatedSensoruseReducedMotionLayout Animationson FabricSETs(Shared Element Transitions)- Animations that use
withRepeatstop repeating after fast refresh is used. - Style doesn’t update on the animation after fast refresh is used.

