Installation

Install the package and its React Native gesture/animation peer dependencies:

npm install @react-native-motion-kit/swipe-deck react-native-gesture-handler react-native-reanimated react-native-worklets

You can use your package manager of choice. For Yarn:

yarn add @react-native-motion-kit/swipe-deck react-native-gesture-handler react-native-reanimated react-native-worklets

Minimum Versions

PackageMinimum
react18.0.0
react-native0.75.0
react-native-gesture-handler2.24.0
react-native-reanimated4.0.0
react-native-worklets0.5.0

React Native Setup

Follow the Reanimated and Worklets setup instructions for your React Native or Expo version. In Babel config, make sure react-native-worklets/plugin is the last Babel plugin.

babel.config.js
module.exports = {
  presets: ['module:@react-native/babel-preset'],
  plugins: ['react-native-worklets/plugin'],
};

Gesture Handler also expects your app surface to be under GestureHandlerRootView.

import { GestureHandlerRootView } from 'react-native-gesture-handler';

export function AppRoot() {
  return <GestureHandlerRootView style={{ flex: 1 }}>{/* app */}</GestureHandlerRootView>;
}