• 한국어
  • 설치

    패키지와 필수 React Native gesture/animation peer dependency를 함께 설치합니다.

    npm
    yarn
    pnpm
    bun
    deno
    npm @react-native-motion-kit/swipe-deck react-native-gesture-handler react-native-reanimated react-native-worklets

    최소 지원 버전

    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 설정

    사용 중인 React Native 또는 Expo 버전에 맞춰 공식 setup guide를 확인하세요.

    Babel 설정에서는 react-native-worklets/plugin을 마지막 Babel plugin으로 추가해야 합니다.

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

    Gesture Handler는 앱 surface가 GestureHandlerRootView 아래에 있어야 합니다.

    import { GestureHandlerRootView } from 'react-native-gesture-handler';
    
    export function AppRoot() {
      return <GestureHandlerRootView style={{ flex: 1 }}>{/* app */}</GestureHandlerRootView>;
    }