Skip to content

Commit c445262

Browse files
committed
removed unsafe memoisation
1 parent 8ab666b commit c445262

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

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

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ const HostGestureDetector = (props: GestureHandlerDetectorProps) => {
1919

2020
const viewRef = useRef(null);
2121
const propsRef = useRef<PropsRef>(props);
22-
const oldHandlerTags = useRef<Set<number>>(new Set<number>());
2322

2423
const detachHandlers = useCallback(() => {
2524
handlerTags.forEach((tag) => {
@@ -28,11 +27,9 @@ const HostGestureDetector = (props: GestureHandlerDetectorProps) => {
2827
}, [handlerTags]);
2928

3029
const attachHandlers = useCallback(() => {
31-
const currentHandlerTags = new Set(handlerTags);
32-
const newHandlerTags = currentHandlerTags.difference(
33-
oldHandlerTags.current
34-
);
35-
newHandlerTags.forEach((tag) => {
30+
// TODO: add memoisation
31+
32+
handlerTags.forEach((tag) => {
3633
RNGestureHandlerModule.attachGestureHandler(
3734
tag,
3835
viewRef.current,
@@ -42,7 +39,6 @@ const HostGestureDetector = (props: GestureHandlerDetectorProps) => {
4239
propsRef
4340
);
4441
});
45-
oldHandlerTags.current = currentHandlerTags;
4642
}, [handlerTags, dispatchesAnimatedEvents]);
4743

4844
useEffect(() => {

0 commit comments

Comments
 (0)