@@ -9,16 +9,12 @@ import React, {
99import { ViewProps } from 'react-native' ;
1010import Animated , {
1111 interpolate ,
12- Extrapolate ,
1312 useAnimatedStyle ,
1413 useAnimatedReaction ,
15- useAnimatedGestureHandler ,
1614 runOnJS ,
15+ Extrapolation ,
1716} from 'react-native-reanimated' ;
18- import {
19- TapGestureHandler ,
20- TapGestureHandlerGestureEvent ,
21- } from 'react-native-gesture-handler' ;
17+ import { Gesture , GestureDetector } from 'react-native-gesture-handler' ;
2218import { useBottomSheet } from '../../hooks' ;
2319import {
2420 DEFAULT_OPACITY ,
@@ -91,15 +87,12 @@ const BottomSheetBackdropComponent = ({
9187 //#endregion
9288
9389 //#region tap gesture
94- const gestureHandler =
95- useAnimatedGestureHandler < TapGestureHandlerGestureEvent > (
96- {
97- onFinish : ( ) => {
98- runOnJS ( handleOnPress ) ( ) ;
99- } ,
100- } ,
101- [ handleOnPress ]
102- ) ;
90+ const tapHandler = useMemo ( ( ) => {
91+ let gesture = Gesture . Tap ( ) . onEnd ( ( ) => {
92+ runOnJS ( handleOnPress ) ( ) ;
93+ } ) ;
94+ return gesture ;
95+ } , [ handleOnPress ] ) ;
10396 //#endregion
10497
10598 //#region styles
@@ -108,7 +101,7 @@ const BottomSheetBackdropComponent = ({
108101 animatedIndex . value ,
109102 [ - 1 , disappearsOnIndex , appearsOnIndex ] ,
110103 [ 0 , 0 , opacity ] ,
111- Extrapolate . CLAMP
104+ Extrapolation . CLAMP
112105 ) ,
113106 flex : 1 ,
114107 } ) ) ;
@@ -160,9 +153,7 @@ const BottomSheetBackdropComponent = ({
160153 ) ;
161154
162155 return pressBehavior !== 'none' ? (
163- < TapGestureHandler onGestureEvent = { gestureHandler } >
164- { AnimatedView }
165- </ TapGestureHandler >
156+ < GestureDetector gesture = { tapHandler } > { AnimatedView } </ GestureDetector >
166157 ) : (
167158 AnimatedView
168159 ) ;
0 commit comments