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) => {
2626 const attachedHandlers = useRef < Set < number > > ( new Set < number > ( ) ) ;
2727 const attachedNativeHandlers = useRef < Set < number > > ( new Set < number > ( ) ) ;
2828 const attachedLogicHandlers = useRef < Map < number , Set < number > > > ( new Map ( ) ) ;
29+ const emptySet = new Set < number > ( ) ;
2930
3031 const detachHandlers = (
3132 currentHandlerTags : Set < number > ,
@@ -126,15 +127,15 @@ const HostGestureDetector = (props: GestureHandlerDetectorProps) => {
126127 } ) ;
127128
128129 logicChildrenToDetach . forEach ( ( tag ) => {
129- detachHandlers ( new Set ( ) , attachedLogicHandlers . current . get ( tag ) ! ) ;
130+ detachHandlers ( emptySet , attachedLogicHandlers . current . get ( tag ) ! ) ;
130131 } ) ;
131132 } , [ props . logicChildren ] ) ;
132133
133134 useEffect ( ( ) => {
134135 return ( ) => {
135- detachHandlers ( new Set ( ) , attachedHandlers . current ) ;
136+ detachHandlers ( emptySet , attachedHandlers . current ) ;
136137 attachedLogicHandlers ?. current . forEach ( ( childHandlerTags ) => {
137- detachHandlers ( new Set ( ) , childHandlerTags ) ;
138+ detachHandlers ( emptySet , childHandlerTags ) ;
138139 } ) ;
139140 } ;
140141 } , [ ] ) ;
You can’t perform that action at this time.
0 commit comments