Migrating from 1.x to 2.x
Migration from Reanimated 3.x to 4.x
Migration Steps
Upgrade the react-native-reanimated package:
Install the react-native-worklets package:
Update Configuration
Expo
Run prebuild to update the native code in the ios and android directories.
And that's it! Reanimated 4 is now configured in your Expo project.
Since Expo SDK 50, the Expo starter template includes the Reanimated Babel plugin by default.
React Native CLI
When using the React Native Community CLI, you also need to manually add the react-native-worklets/plugin plugin to your babel.config.js.
babel.config.js
Remove wrapWithReanimatedMetroConfig from your metro.config.js.
metro.config.js
Remove currentIndex and totalCount from useGestureViewerController
❗ Breaking Change
useGestureViewerControllerno longer returnscurrentIndexandtotalCount. UseuseGestureViewerStateinstead.- Rename
GestureViewerControllerStatetype toGestureViewerState
Remove onIndexChange prop
❗ Breaking Change
onIndexChange prop has been removed. Use useGestureViewerState with useEffect instead.
Rename gesture props
Improve gesture prop naming for better developer experience.
❗ Breaking Change
enableDismissGesture→dismiss.enableddismissThreshold→dismiss.thresholdresistance→dismiss.resistanceanimateBackdrop→dismiss.fadeBackdropuseSnap→enableSnapModeenableZoomPanGesture→enablePanWhenZoomedenableZoomGesture→enablePinchZoomenableSwipeGesture→enableHorizontalSwipe
