React Native Reanimated is a high-performance animation library for React Native, offering a powerful and flexible alternative to the built-in `Animated` API. It enables animations to run directly on the native UI thread, completely decoupling them from the JavaScript thread, which results in significantly smoother and more reliable user experiences, especially under heavy load or during complex interactions. The current stable version is 4.3.0, with frequent patch and minor updates. The library maintains a rapid release cadence, often introducing core infrastructure improvements via the tightly coupled `react-native-worklets` package, like the recent `Shareable` memory type. Key differentiators include its worklet-based architecture, allowing direct UI thread execution of JavaScript functions, and recent advancements such as CSS SVG animations for `Path`, `Image`, `LinearGradient`, `RadialGradient`, `Pattern`, and `Text` components, including advanced path morphing capabilities.
npm install react-native-reanimatedVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates a basic animation where a box's horizontal position is animated using `useSharedValue` and `useAnimatedStyle` with a spring effect upon button press. This showcases UI thread animation.
Migrate all animation logic to the new hooks-based API using `useSharedValue`, `useAnimatedStyle`, `withTiming`, `withSpring`, etc. Consult the official migration guides for detailed steps between major versions.
Ensure `react-native-reanimated/plugin` is correctly listed as the *last* plugin in your `babel.config.js` file. Example: `plugins: [['react-native-reanimated/plugin']]`. Clear your Metro cache and rebuild the app afterwards.
Refactor code using `useAnimatedKeyboard` to integrate with `react-native-keyboard-controller`. Refer to the `react-native-keyboard-controller` documentation for the new implementation details.
For projects requiring static feature flags or advanced native module capabilities, use a custom development client (Expo Development Build) instead of the standard Expo Go client.
Always ensure that your `react-native` and `react-native-worklets` versions precisely match the peer dependency requirements specified in `react-native-reanimated`'s `package.json` for your installed version.
Double-check that `react-native-reanimated/plugin` is correctly installed and listed as the *last* plugin in your `babel.config.js`. After modification, clear your Metro cache (`npx react-native start --reset-cache`) and rebuild your application.
For bare React Native projects, ensure `pod install` (iOS) or `npx react-native run-android` (Android) has been executed after installation. For Expo projects, you *must* use a custom development client (`expo prebuild` and `eas build --profile development`) as Reanimated is a native module.
Ensure that any variable you expect to be a `SharedValue` is properly initialized using `useSharedValue(initialValue)` before accessing its `.value` property. Verify correct prop drilling if passing shared values between components.
Configure Jest to mock `react-native-reanimated` properly. A common approach is to use `jest.mock('react-native-reanimated', () => require('react-native-reanimated/mock'));` in your Jest setup file.