File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
packages/react-native-gesture-handler/src/v3/NativeDetector Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ const HostGestureDetector = (props: GestureHandlerDetectorProps) => {
26
26
const attachedHandlers = useRef < Set < number > > ( new Set < number > ( ) ) ;
27
27
const attachedNativeHandlers = useRef < Set < number > > ( new Set < number > ( ) ) ;
28
28
const attachedLogicHandlers = useRef < Map < number , Set < number > > > ( new Map ( ) ) ;
29
+ const emptySet = new Set < number > ( ) ;
29
30
30
31
const detachHandlers = (
31
32
currentHandlerTags : Set < number > ,
@@ -126,15 +127,15 @@ const HostGestureDetector = (props: GestureHandlerDetectorProps) => {
126
127
} ) ;
127
128
128
129
logicChildrenToDetach . forEach ( ( tag ) => {
129
- detachHandlers ( new Set ( ) , attachedLogicHandlers . current . get ( tag ) ! ) ;
130
+ detachHandlers ( emptySet , attachedLogicHandlers . current . get ( tag ) ! ) ;
130
131
} ) ;
131
132
} , [ props . logicChildren ] ) ;
132
133
133
134
useEffect ( ( ) => {
134
135
return ( ) => {
135
- detachHandlers ( new Set ( ) , attachedHandlers . current ) ;
136
+ detachHandlers ( emptySet , attachedHandlers . current ) ;
136
137
attachedLogicHandlers ?. current . forEach ( ( childHandlerTags ) => {
137
- detachHandlers ( new Set ( ) , childHandlerTags ) ;
138
+ detachHandlers ( emptySet , childHandlerTags ) ;
138
139
} ) ;
139
140
} ;
140
141
} , [ ] ) ;
You can’t perform that action at this time.
0 commit comments