@@ -17,17 +17,34 @@ export interface GestureHandlerDetectorProps extends ViewProps {
17
17
dispatchesAnimatedEvents : boolean ;
18
18
moduleId : number ;
19
19
}
20
+
20
21
const GestureHandlerDetector = ( props : GestureHandlerDetectorProps ) => {
21
- const { handlerTags } = props ;
22
+ const {
23
+ onGestureHandlerEvent,
24
+ onGestureHandlerAnimatedEvent,
25
+ onGestureHandlerStateChange,
26
+ onGestureHandlerTouchEvent,
27
+ handlerTags,
28
+ dispatchesAnimatedEvents,
29
+ moduleId,
30
+ } = props ;
22
31
23
32
const viewRef = useRef ( null ) ;
24
33
const propsRef = useRef < GestureHandlerDetectorProps > ( props ) ;
25
34
26
35
useEffect ( ( ) => {
27
- updateProps ( ) ;
28
- } , [ props ] ) ;
36
+ attachHandlers ( ) ;
37
+ } , [
38
+ onGestureHandlerEvent ,
39
+ onGestureHandlerAnimatedEvent ,
40
+ onGestureHandlerStateChange ,
41
+ onGestureHandlerTouchEvent ,
42
+ handlerTags ,
43
+ dispatchesAnimatedEvents ,
44
+ moduleId ,
45
+ ] ) ;
29
46
30
- const updateProps = ( ) : void => {
47
+ const attachHandlers = ( ) : void => {
31
48
handlerTags . forEach ( ( tag ) => {
32
49
RNGestureHandlerModuleWeb . attachGestureHandler (
33
50
tag ,
@@ -39,4 +56,5 @@ const GestureHandlerDetector = (props: GestureHandlerDetectorProps) => {
39
56
} ;
40
57
return < View ref = { viewRef } > { props . children } </ View > ;
41
58
} ;
59
+
42
60
export default GestureHandlerDetector ;
0 commit comments