File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import React from 'react';
22import type { FlexStyle , ViewStyle } from 'react-native' ;
33import {
44 PanGestureHandler ,
5+ PanGestureHandlerProps ,
56 PanGestureHandlerGestureEvent ,
67} from 'react-native-gesture-handler' ;
78import Animated , {
@@ -97,6 +98,10 @@ export interface ICarouselProps<T extends unknown> {
9798 * On scroll end
9899 */
99100 onScrollEnd ?: ( previous : number , current : number ) => void ;
101+ /**
102+ * PanGestureHandler props
103+ */
104+ handlerProps ?: Omit < PanGestureHandlerProps , 'onHandlerStateChange' > ;
100105}
101106
102107export interface ICarouselInstance {
@@ -138,6 +143,7 @@ function Carousel<T extends unknown = any>(
138143 onSnapToItem,
139144 style,
140145 timingConfig = defaultTimingConfig ,
146+ handlerProps,
141147 } = props ;
142148 const lockController = useLockController ( ) ;
143149 const handlerOffsetX = useSharedValue < number > ( 0 ) ;
@@ -363,7 +369,10 @@ function Carousel<T extends unknown = any>(
363369 ] ) ;
364370
365371 return (
366- < PanGestureHandler onHandlerStateChange = { animatedListScrollHandler } >
372+ < PanGestureHandler
373+ onHandlerStateChange = { animatedListScrollHandler }
374+ { ...handlerProps }
375+ >
367376 < Animated . View
368377 style = { [
369378 // eslint-disable-next-line react-native/no-inline-styles
You can’t perform that action at this time.
0 commit comments