Skip to content

Commit b738254

Browse files
committed
removed usecallback
1 parent dceba3b commit b738254

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

packages/react-native-gesture-handler/src/v3/HostGestureDetector.web.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useEffect, useRef, useCallback } from 'react';
1+
import { useEffect, useRef } from 'react';
22
import { View } from 'react-native';
33
import RNGestureHandlerModule from '../RNGestureHandlerModule.web';
44
import { ActionType } from '../ActionType';
@@ -17,13 +17,13 @@ const HostGestureDetector = (props: GestureHandlerDetectorProps) => {
1717
const propsRef = useRef<PropsRef>(props);
1818
const attachedHandlerTags = useRef<Set<number>>(new Set<number>());
1919

20-
const detachHandlers = useCallback((oldHandlerTags: Set<number>) => {
20+
const detachHandlers = (oldHandlerTags: Set<number>) => {
2121
oldHandlerTags.forEach((tag) => {
2222
RNGestureHandlerModule.detachGestureHandler(tag);
2323
});
24-
}, []);
24+
};
2525

26-
const attachHandlers = useCallback((currentHandlerTags: Set<number>) => {
26+
const attachHandlers = (currentHandlerTags: Set<number>) => {
2727
const oldHandlerTags =
2828
attachedHandlerTags.current.difference(currentHandlerTags);
2929
const newHandlerTags = currentHandlerTags.difference(
@@ -41,7 +41,7 @@ const HostGestureDetector = (props: GestureHandlerDetectorProps) => {
4141
);
4242
});
4343
attachedHandlerTags.current = currentHandlerTags;
44-
}, []);
44+
};
4545

4646
useEffect(() => {
4747
attachHandlers(new Set(handlerTags));

0 commit comments

Comments
 (0)