Skip to content

Commit 738a33c

Browse files
christianbachChristian Bach
authored andcommitted
fix: ensure SwipeDirection is imported as a value in ReanimatedSwipeable (#3666)
**Summary** Fixes `SwipeDirection` being `undefined` at runtime in `ReanimatedSwipeable` when the package is consumed from TypeScript source (e.g. in some Metro configs). **Details** `SwipeDirection` was imported from the local barrel (`./index.ts`), which re-exports it as a type-only export. This removes the value in the compiled JS, causing it to be `undefined` at runtime. This PR imports `SwipeDirection` directly from `ReanimatedSwipeableProps`, which exports it as a value. See closed issue for details: [#3665](#3665) **Impact** No API changes. Only affects internal import, ensures enum value is present at runtime. --------- Co-authored-by: Christian Bach <[email protected]>
1 parent 676d0d7 commit 738a33c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/react-native-gesture-handler/src/components/ReanimatedSwipeable/ReanimatedSwipeable.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@ import Animated, {
1111
runOnUI,
1212
useAnimatedStyle,
1313
} from 'react-native-reanimated';
14-
import { SwipeableProps, SwipeableMethods, SwipeDirection } from '.';
14+
import {
15+
SwipeableProps,
16+
SwipeableMethods,
17+
SwipeDirection,
18+
} from './ReanimatedSwipeableProps';
1519
import { Gesture } from '../..';
1620
import {
1721
GestureStateChangeEvent,

0 commit comments

Comments
 (0)