Skip to content

Commit cb72d7e

Browse files
committed
removed unnessary check
1 parent 079fdb4 commit cb72d7e

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

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

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ const HostGestureDetector = (props: GestureHandlerDetectorProps) => {
1515
const viewRef = useRef(null);
1616
const propsRef = useRef<GestureHandlerDetectorProps>(props);
1717
const oldHandlerTags = useRef<Set<number>>(new Set<number>());
18-
const oldDispatchesAnimatedEvents = useRef<boolean>(null);
1918

2019
const detachHandlers = useCallback(() => {
2120
handlerTags.forEach((tag) => {
@@ -24,11 +23,6 @@ const HostGestureDetector = (props: GestureHandlerDetectorProps) => {
2423
}, [handlerTags]);
2524

2625
const attachHandlers = useCallback(() => {
27-
if (oldDispatchesAnimatedEvents.current !== dispatchesAnimatedEvents) {
28-
// We reattach handlers, if the action type changes
29-
oldHandlerTags.current = new Set<number>();
30-
detachHandlers();
31-
}
3226
const currentHandlerTags = new Set(handlerTags);
3327
const newHandlerTags = currentHandlerTags.difference(
3428
oldHandlerTags.current
@@ -44,7 +38,7 @@ const HostGestureDetector = (props: GestureHandlerDetectorProps) => {
4438
);
4539
});
4640
oldHandlerTags.current = currentHandlerTags;
47-
}, [handlerTags, dispatchesAnimatedEvents, detachHandlers]);
41+
}, [handlerTags, dispatchesAnimatedEvents]);
4842

4943
useEffect(() => {
5044
attachHandlers();

0 commit comments

Comments
 (0)