Skip to content

Commit 008cd0c

Browse files
authored
Added onStart/EndSwipe triggers to DeckSwiper (#714)
1 parent c720051 commit 008cd0c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

packages/core/src/components/DeckSwiper/DeckSwiper.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import { StyleProp, ViewStyle, StyleSheet, View } from "react-native";
33
import DeckSwiperComponent from "react-native-deck-swiper";
44

55
export interface DeckSwiperProps<T> {
6+
onStartSwipe?: () => void;
7+
onEndSwipe?: () => void;
68
onSwipe?: (index: number) => void;
79
onSwipedLeft?: (index: number) => void;
810
onSwipedRight?: (index: number) => void;
@@ -22,6 +24,8 @@ export interface DeckSwiperProps<T> {
2224
}
2325

2426
const DeckSwiper = <T extends object>({
27+
onStartSwipe,
28+
onEndSwipe,
2529
onSwipe,
2630
onSwipedLeft,
2731
onSwipedRight,
@@ -150,6 +154,10 @@ const DeckSwiper = <T extends object>({
150154
onSwipedDown?.(index);
151155
onSwipe?.(index);
152156
}}
157+
//@ts-ignore Not typed, but is implemented and works
158+
dragStart={onStartSwipe}
159+
//@ts-ignore
160+
dragEnd={onEndSwipe}
153161
/>
154162
</View>
155163
);

0 commit comments

Comments
 (0)