diff --git a/packages/react-native-gesture-handler/src/__tests__/RelationsTraversal.test.tsx b/packages/react-native-gesture-handler/src/__tests__/RelationsTraversal.test.tsx index 99238234f4..89baee3457 100644 --- a/packages/react-native-gesture-handler/src/__tests__/RelationsTraversal.test.tsx +++ b/packages/react-native-gesture-handler/src/__tests__/RelationsTraversal.test.tsx @@ -75,10 +75,10 @@ describe('Simple relations', () => { configureRelations(composedGesture); expect(pan1.gestureRelations.simultaneousHandlers).toStrictEqual([ - pan2.tag, + pan2.handlerTag, ]); expect(pan2.gestureRelations.simultaneousHandlers).toStrictEqual([ - pan1.tag, + pan1.handlerTag, ]); }); @@ -88,7 +88,7 @@ describe('Simple relations', () => { configureRelations(composedGesture); - expect(pan1.gestureRelations.waitFor).toStrictEqual([pan2.tag]); + expect(pan1.gestureRelations.waitFor).toStrictEqual([pan2.handlerTag]); expect(pan2.gestureRelations.waitFor).toStrictEqual([]); }); @@ -131,13 +131,13 @@ describe('External relations', () => { configureRelations(pan3); expect(pan1.gestureRelations.simultaneousHandlers.sort()).toStrictEqual( - [pan2.tag, pan3.tag].sort() + [pan2.handlerTag, pan3.handlerTag].sort() ); expect(pan2.gestureRelations.simultaneousHandlers.sort()).toStrictEqual( - [pan1.tag, pan3.tag].sort() + [pan1.handlerTag, pan3.handlerTag].sort() ); expect(pan3.gestureRelations.simultaneousHandlers.sort()).toStrictEqual( - [pan1.tag, pan2.tag].sort() + [pan1.handlerTag, pan2.handlerTag].sort() ); }); @@ -163,8 +163,11 @@ describe('External relations', () => { configureRelations(pan3); expect(pan1.gestureRelations.waitFor).toStrictEqual([]); - expect(pan2.gestureRelations.waitFor).toStrictEqual([pan1.tag]); - expect(pan3.gestureRelations.waitFor).toStrictEqual([pan1.tag, pan2.tag]); + expect(pan2.gestureRelations.waitFor).toStrictEqual([pan1.handlerTag]); + expect(pan3.gestureRelations.waitFor).toStrictEqual([ + pan1.handlerTag, + pan2.handlerTag, + ]); }); test('blocks', () => { @@ -189,10 +192,12 @@ describe('External relations', () => { configureRelations(pan3); expect(pan1.gestureRelations.blocksHandlers).toStrictEqual([]); - expect(pan2.gestureRelations.blocksHandlers).toStrictEqual([pan1.tag]); + expect(pan2.gestureRelations.blocksHandlers).toStrictEqual([ + pan1.handlerTag, + ]); expect(pan3.gestureRelations.blocksHandlers).toStrictEqual([ - pan1.tag, - pan2.tag, + pan1.handlerTag, + pan2.handlerTag, ]); }); }); @@ -241,35 +246,35 @@ describe('Complex relations', () => { expect(tap1.gestureRelations.waitFor).toStrictEqual([]); expect(tap1.gestureRelations.simultaneousHandlers).toStrictEqual([ - pan1.tag, + pan1.handlerTag, ]); - expect(tap2.gestureRelations.waitFor).toStrictEqual([tap1.tag]); + expect(tap2.gestureRelations.waitFor).toStrictEqual([tap1.handlerTag]); expect(tap2.gestureRelations.simultaneousHandlers).toStrictEqual([ - pan1.tag, + pan1.handlerTag, ]); expect(pan1.gestureRelations.waitFor).toStrictEqual([]); expect(pan1.gestureRelations.simultaneousHandlers.sort()).toStrictEqual( - [tap1.tag, tap2.tag].sort() + [tap1.handlerTag, tap2.handlerTag].sort() ); expect(pan2.gestureRelations.waitFor).toStrictEqual([ - tap1.tag, - tap2.tag, - pan1.tag, + tap1.handlerTag, + tap2.handlerTag, + pan1.handlerTag, ]); expect(pan2.gestureRelations.simultaneousHandlers).toStrictEqual([ - pan3.tag, + pan3.handlerTag, ]); expect(pan3.gestureRelations.waitFor).toStrictEqual([ - tap1.tag, - tap2.tag, - pan1.tag, + tap1.handlerTag, + tap2.handlerTag, + pan1.handlerTag, ]); expect(pan3.gestureRelations.simultaneousHandlers).toStrictEqual([ - pan2.tag, + pan2.handlerTag, ]); }); @@ -284,14 +289,14 @@ describe('Complex relations', () => { expect(tap1.gestureRelations.waitFor).toStrictEqual([]); expect(tap1.gestureRelations.simultaneousHandlers).toStrictEqual([]); - expect(pan1.gestureRelations.waitFor).toStrictEqual([tap1.tag]); + expect(pan1.gestureRelations.waitFor).toStrictEqual([tap1.handlerTag]); expect(pan1.gestureRelations.simultaneousHandlers).toStrictEqual([ - pan2.tag, + pan2.handlerTag, ]); - expect(pan2.gestureRelations.waitFor).toStrictEqual([tap1.tag]); + expect(pan2.gestureRelations.waitFor).toStrictEqual([tap1.handlerTag]); expect(pan2.gestureRelations.simultaneousHandlers).toStrictEqual([ - pan1.tag, + pan1.handlerTag, ]); }); @@ -304,10 +309,13 @@ describe('Complex relations', () => { expect(tap1.gestureRelations.waitFor).toStrictEqual([]); expect(tap1.gestureRelations.simultaneousHandlers).toStrictEqual([]); - expect(tap2.gestureRelations.waitFor).toStrictEqual([tap1.tag]); + expect(tap2.gestureRelations.waitFor).toStrictEqual([tap1.handlerTag]); expect(tap2.gestureRelations.simultaneousHandlers).toStrictEqual([]); - expect(tap3.gestureRelations.waitFor).toStrictEqual([tap1.tag, tap2.tag]); + expect(tap3.gestureRelations.waitFor).toStrictEqual([ + tap1.handlerTag, + tap2.handlerTag, + ]); expect(tap3.gestureRelations.simultaneousHandlers).toStrictEqual([]); }); }); @@ -355,35 +363,35 @@ describe('Complex relations with external gestures', () => { configureRelations(E); expect(pan1.gestureRelations.simultaneousHandlers.sort()).toStrictEqual( - [pan2.tag, pan5.tag].sort() + [pan2.handlerTag, pan5.handlerTag].sort() ); expect(pan1.gestureRelations.waitFor).toStrictEqual([]); expect(pan2.gestureRelations.simultaneousHandlers.sort()).toStrictEqual( - [pan1.tag, pan5.tag].sort() + [pan1.handlerTag, pan5.handlerTag].sort() ); expect(pan2.gestureRelations.waitFor).toStrictEqual([]); expect(pan3.gestureRelations.simultaneousHandlers).toStrictEqual([ - pan4.tag, + pan4.handlerTag, ]); expect(pan3.gestureRelations.waitFor).toStrictEqual([ - pan5.tag, - pan1.tag, - pan2.tag, + pan5.handlerTag, + pan1.handlerTag, + pan2.handlerTag, ]); expect(pan4.gestureRelations.simultaneousHandlers).toStrictEqual([ - pan3.tag, + pan3.handlerTag, ]); expect(pan4.gestureRelations.waitFor).toStrictEqual([ - pan5.tag, - pan1.tag, - pan2.tag, + pan5.handlerTag, + pan1.handlerTag, + pan2.handlerTag, ]); expect(pan5.gestureRelations.simultaneousHandlers.sort()).toStrictEqual( - [pan1.tag, pan2.tag].sort() + [pan1.handlerTag, pan2.handlerTag].sort() ); }); @@ -428,31 +436,31 @@ describe('Complex relations with external gestures', () => { configureRelations(S); expect(pan1.gestureRelations.simultaneousHandlers.sort()).toStrictEqual( - [pan4.tag, pan5.tag, pan3.tag].sort() + [pan4.handlerTag, pan5.handlerTag, pan3.handlerTag].sort() ); expect(pan1.gestureRelations.waitFor).toStrictEqual([]); expect(pan2.gestureRelations.simultaneousHandlers).toStrictEqual([ - pan3.tag, + pan3.handlerTag, ]); expect(pan2.gestureRelations.waitFor).toStrictEqual([ - pan4.tag, - pan5.tag, - pan1.tag, + pan4.handlerTag, + pan5.handlerTag, + pan1.handlerTag, ]); expect(pan3.gestureRelations.simultaneousHandlers.sort()).toStrictEqual( - [pan1.tag, pan2.tag].sort() + [pan1.handlerTag, pan2.handlerTag].sort() ); expect(pan3.gestureRelations.waitFor).toStrictEqual([]); expect(pan4.gestureRelations.simultaneousHandlers).toStrictEqual([ - pan1.tag, + pan1.handlerTag, ]); expect(pan4.gestureRelations.waitFor).toStrictEqual([]); expect(pan5.gestureRelations.simultaneousHandlers).toStrictEqual([ - pan1.tag, + pan1.handlerTag, ]); expect(pan5.gestureRelations.waitFor).toStrictEqual([]); }); @@ -487,13 +495,13 @@ describe('External relations with composed gestures', () => { configureRelations(pan3); expect(pan1.gestureRelations.simultaneousHandlers.sort()).toStrictEqual( - [pan2.tag, pan3.tag].sort() + [pan2.handlerTag, pan3.handlerTag].sort() ); expect(pan2.gestureRelations.simultaneousHandlers.sort()).toStrictEqual( - [pan1.tag, pan3.tag].sort() + [pan1.handlerTag, pan3.handlerTag].sort() ); expect(pan3.gestureRelations.simultaneousHandlers.sort()).toStrictEqual( - [pan1.tag, pan2.tag].sort() + [pan1.handlerTag, pan2.handlerTag].sort() ); }); @@ -525,13 +533,13 @@ describe('External relations with composed gestures', () => { configureRelations(composedGesture); expect(pan1.gestureRelations.simultaneousHandlers.sort()).toStrictEqual( - [pan2.tag, pan3.tag].sort() + [pan2.handlerTag, pan3.handlerTag].sort() ); expect(pan2.gestureRelations.simultaneousHandlers.sort()).toStrictEqual( - [pan1.tag, pan3.tag].sort() + [pan1.handlerTag, pan3.handlerTag].sort() ); expect(pan3.gestureRelations.simultaneousHandlers.sort()).toStrictEqual( - [pan1.tag, pan2.tag].sort() + [pan1.handlerTag, pan2.handlerTag].sort() ); }); }); diff --git a/packages/react-native-gesture-handler/src/jestUtils/jestUtils.ts b/packages/react-native-gesture-handler/src/jestUtils/jestUtils.ts index ee7a951c57..9d3eb1b745 100644 --- a/packages/react-native-gesture-handler/src/jestUtils/jestUtils.ts +++ b/packages/react-native-gesture-handler/src/jestUtils/jestUtils.ts @@ -433,7 +433,7 @@ function getHandlerData( if (isHookGesture(componentOrGesture)) { return { handlerType: componentOrGesture.type as HandlerNames, - handlerTag: componentOrGesture.tag, + handlerTag: componentOrGesture.handlerTag, enabled: maybeUnpackValue(componentOrGesture.config.enabled), emitEvent: (eventName, args) => { const { state, oldState, handlerTag, ...rest } = args.nativeEvent; diff --git a/packages/react-native-gesture-handler/src/v3/components/GestureComponents.tsx b/packages/react-native-gesture-handler/src/v3/components/GestureComponents.tsx index 0c53dab2f4..2a43af7b28 100644 --- a/packages/react-native-gesture-handler/src/v3/components/GestureComponents.tsx +++ b/packages/react-native-gesture-handler/src/v3/components/GestureComponents.tsx @@ -66,7 +66,7 @@ export const ScrollView = ( const updateGesture = (gesture: NativeGesture) => { ghQueueMicrotask(() => { - if (!scrollGesture || scrollGesture.tag !== gesture.tag) { + if (!scrollGesture || scrollGesture.handlerTag !== gesture.handlerTag) { setScrollGesture(gesture); onGestureUpdate_CAN_CAUSE_INFINITE_RERENDER?.(gesture); } @@ -123,7 +123,7 @@ export const FlatList = ((props) => { const updateGesture = (gesture: NativeGesture) => { ghQueueMicrotask(() => { - if (!scrollGesture || scrollGesture.tag !== gesture.tag) { + if (!scrollGesture || scrollGesture.handlerTag !== gesture.handlerTag) { setScrollGesture(gesture); onGestureUpdate_CAN_CAUSE_INFINITE_RERENDER?.(gesture); } diff --git a/packages/react-native-gesture-handler/src/v3/detectors/NativeDetector.tsx b/packages/react-native-gesture-handler/src/v3/detectors/NativeDetector.tsx index 249da97d7e..c75e26cf57 100644 --- a/packages/react-native-gesture-handler/src/v3/detectors/NativeDetector.tsx +++ b/packages/react-native-gesture-handler/src/v3/detectors/NativeDetector.tsx @@ -26,7 +26,9 @@ export function NativeDetector({ configureRelations(gesture); const handlerTags = useMemo(() => { - return isComposedGesture(gesture) ? gesture.tags : [gesture.tag]; + return isComposedGesture(gesture) + ? gesture.handlerTags + : [gesture.handlerTag]; }, [gesture]); return ( diff --git a/packages/react-native-gesture-handler/src/v3/detectors/VirtualDetector/InterceptingGestureDetector.tsx b/packages/react-native-gesture-handler/src/v3/detectors/VirtualDetector/InterceptingGestureDetector.tsx index 8b4fe6ad25..7bf7dcfa99 100644 --- a/packages/react-native-gesture-handler/src/v3/detectors/VirtualDetector/InterceptingGestureDetector.tsx +++ b/packages/react-native-gesture-handler/src/v3/detectors/VirtualDetector/InterceptingGestureDetector.tsx @@ -208,7 +208,9 @@ export function InterceptingGestureDetector({ const handlerTags = useMemo(() => { if (gesture) { - return isComposedGesture(gesture) ? gesture.tags : [gesture.tag]; + return isComposedGesture(gesture) + ? gesture.handlerTags + : [gesture.handlerTag]; } return []; }, [gesture]); diff --git a/packages/react-native-gesture-handler/src/v3/detectors/VirtualDetector/VirtualDetector.tsx b/packages/react-native-gesture-handler/src/v3/detectors/VirtualDetector/VirtualDetector.tsx index 3143da5953..c25af2d16e 100644 --- a/packages/react-native-gesture-handler/src/v3/detectors/VirtualDetector/VirtualDetector.tsx +++ b/packages/react-native-gesture-handler/src/v3/detectors/VirtualDetector/VirtualDetector.tsx @@ -57,8 +57,8 @@ export function VirtualDetector( } const handlerTags = isComposedGesture(props.gesture) - ? props.gesture.tags - : [props.gesture.tag]; + ? props.gesture.handlerTags + : [props.gesture.handlerTag]; if (props.gesture.config.dispatchesAnimatedEvents) { throw new Error( diff --git a/packages/react-native-gesture-handler/src/v3/detectors/utils.ts b/packages/react-native-gesture-handler/src/v3/detectors/utils.ts index 2c8f51a126..c627f56e4c 100644 --- a/packages/react-native-gesture-handler/src/v3/detectors/utils.ts +++ b/packages/react-native-gesture-handler/src/v3/detectors/utils.ts @@ -21,12 +21,12 @@ export const traverseAndConfigureRelations = ( // If we are in the leaf node, we want to fill gesture relations arrays with current // waitFor and simultaneousHandlers. We also want to configure relations on the native side. if (!isComposedGesture(node)) { - node.gestureRelations = prepareRelations(node.config, node.tag); + node.gestureRelations = prepareRelations(node.config, node.handlerTag); node.gestureRelations.simultaneousHandlers.push(...simultaneousHandlers); node.gestureRelations.waitFor.push(...waitFor); - NativeProxy.configureRelations(node.tag, { + NativeProxy.configureRelations(node.handlerTag, { waitFor: node.gestureRelations.waitFor, simultaneousHandlers: node.gestureRelations.simultaneousHandlers, blocksHandlers: node.gestureRelations.blocksHandlers, @@ -50,7 +50,9 @@ export const traverseAndConfigureRelations = ( node.type !== ComposedGestureName.Simultaneous && child.type === ComposedGestureName.Simultaneous ) { - child.tags.forEach((tag) => simultaneousHandlers.add(tag)); + child.handlerTags.forEach((handlerTag) => + simultaneousHandlers.add(handlerTag) + ); } // If we go from a simultaneous gesture to a non-simultaneous gesture, @@ -60,7 +62,9 @@ export const traverseAndConfigureRelations = ( node.type === ComposedGestureName.Simultaneous && child.type !== ComposedGestureName.Simultaneous ) { - child.tags.forEach((tag) => simultaneousHandlers.delete(tag)); + child.handlerTags.forEach((handlerTag) => + simultaneousHandlers.delete(handlerTag) + ); } // We will keep the current length of `waitFor` to reset it to previous state @@ -79,7 +83,9 @@ export const traverseAndConfigureRelations = ( child.type === ComposedGestureName.Simultaneous && node.type !== ComposedGestureName.Simultaneous ) { - node.tags.forEach((tag) => simultaneousHandlers.delete(tag)); + node.handlerTags.forEach((handlerTag) => + simultaneousHandlers.delete(handlerTag) + ); } // If we go back from a non-simultaneous gesture to a simultaneous gesture, @@ -89,13 +95,15 @@ export const traverseAndConfigureRelations = ( child.type !== ComposedGestureName.Simultaneous && node.type === ComposedGestureName.Simultaneous ) { - node.tags.forEach((tag) => simultaneousHandlers.add(tag)); + node.handlerTags.forEach((handlerTag) => + simultaneousHandlers.add(handlerTag) + ); } // If we go back to an exclusive gesture, we want to add the tags of the child gesture to the `waitFor` array. // This will allow us to pass exclusive gesture tags to the right subtree of the current node. if (node.type === ComposedGestureName.Exclusive) { - child.tags.forEach((tag) => waitFor.push(tag)); + child.handlerTags.forEach((handlerTag) => waitFor.push(handlerTag)); } // If we go back from an exclusive gesture to a non-exclusive gesture, we want to reset the `waitFor` array @@ -111,17 +119,17 @@ export const traverseAndConfigureRelations = ( // This means that child is a leaf node. else { // We don't want to mark gesture as simultaneous with itself, so we remove its tag from the set. - const hasRemovedTag = simultaneousHandlers.delete(child.tag); + const hasRemovedTag = simultaneousHandlers.delete(child.handlerTag); traverseAndConfigureRelations(child, simultaneousHandlers, waitFor); if (hasRemovedTag) { - simultaneousHandlers.add(child.tag); + simultaneousHandlers.add(child.handlerTag); } // In the leaf node, we only care about filling `waitFor` array. if (node.type === ComposedGestureName.Exclusive) { - waitFor.push(child.tag); + waitFor.push(child.handlerTag); } } }); @@ -137,12 +145,17 @@ export function configureRelations( // If root is simultaneous, we want to add its tags to the set if (gesture.type === ComposedGestureName.Simultaneous) { - gesture.tags.forEach((tag) => simultaneousHandlers.add(tag)); + gesture.handlerTags.forEach((handlerTag) => + simultaneousHandlers.add(handlerTag) + ); } traverseAndConfigureRelations(gesture, simultaneousHandlers); } else { - NativeProxy.configureRelations(gesture.tag, gesture.gestureRelations); + NativeProxy.configureRelations( + gesture.handlerTag, + gesture.gestureRelations + ); } } diff --git a/packages/react-native-gesture-handler/src/v3/hooks/composition/useComposedGesture.ts b/packages/react-native-gesture-handler/src/v3/hooks/composition/useComposedGesture.ts index ad2280808d..33c074df8a 100644 --- a/packages/react-native-gesture-handler/src/v3/hooks/composition/useComposedGesture.ts +++ b/packages/react-native-gesture-handler/src/v3/hooks/composition/useComposedGesture.ts @@ -16,11 +16,11 @@ export function useComposedGesture( type: ComposedGestureName, ...gestures: AnyGesture[] ): ComposedGesture { - const tags = gestures.flatMap((gesture) => - isComposedGesture(gesture) ? gesture.tags : gesture.tag + const handlerTags = gestures.flatMap((gesture) => + isComposedGesture(gesture) ? gesture.handlerTags : [gesture.handlerTag] ); - if (containsDuplicates(tags)) { + if (containsDuplicates(handlerTags)) { throw new Error( tagMessage( 'Each gesture can be used only once in the gesture composition.' @@ -113,7 +113,7 @@ export function useComposedGesture( } return { - tags, + handlerTags, type, config, detectorCallbacks: { diff --git a/packages/react-native-gesture-handler/src/v3/hooks/useGesture.ts b/packages/react-native-gesture-handler/src/v3/hooks/useGesture.ts index 98b49879a8..7c07adee68 100644 --- a/packages/react-native-gesture-handler/src/v3/hooks/useGesture.ts +++ b/packages/react-native-gesture-handler/src/v3/hooks/useGesture.ts @@ -22,7 +22,7 @@ export function useGesture( type: SingleGestureName, config: BaseGestureConfig ): SingleGesture { - const tag = useMemo(() => getNextHandlerTag(), []); + const handlerTag = useMemo(() => getNextHandlerTag(), []); const disableReanimated = useMemo(() => config.disableReanimated, []); if (config.disableReanimated !== disableReanimated) { @@ -41,7 +41,7 @@ export function useGesture( onGestureHandlerEvent, onReanimatedEvent, onGestureHandlerAnimatedEvent, - } = useGestureCallbacks(tag, config); + } = useGestureCallbacks(handlerTag, config); if (config.shouldUseReanimatedDetector && !onReanimatedEvent) { throw new Error(tagMessage('Failed to create reanimated event handlers.')); @@ -55,23 +55,23 @@ export function useGesture( requireToFail: config.requireToFail, block: config.block, }, - tag + handlerTag ), - [tag, config.simultaneousWith, config.requireToFail, config.block] + [handlerTag, config.simultaneousWith, config.requireToFail, config.block] ); - const currentGestureRef = useRef({ type: '', tag: -1 }); + const currentGestureRef = useRef({ type: '', handlerTag: -1 }); if ( - currentGestureRef.current.tag !== tag || + currentGestureRef.current.handlerTag !== handlerTag || currentGestureRef.current.type !== (type as string) ) { - currentGestureRef.current = { type, tag }; - NativeProxy.createGestureHandler(type, tag, {}); + currentGestureRef.current = { type, handlerTag }; + NativeProxy.createGestureHandler(type, handlerTag, {}); } const gesture = useMemo( () => ({ - tag, + handlerTag, type, config, detectorCallbacks: { @@ -100,7 +100,7 @@ export function useGesture( gestureRelations, }), [ - tag, + handlerTag, type, config, onGestureHandlerEvent, @@ -112,24 +112,24 @@ export function useGesture( useEffect(() => { return () => { - NativeProxy.dropGestureHandler(tag); + NativeProxy.dropGestureHandler(handlerTag); scheduleFlushOperations(); }; - }, [type, tag]); + }, [type, handlerTag]); useEffect(() => { const preparedConfig = prepareConfigForNativeSide(type, config); - NativeProxy.setGestureHandlerConfig(tag, preparedConfig); + NativeProxy.setGestureHandlerConfig(handlerTag, preparedConfig); scheduleFlushOperations(); - bindSharedValues(config, tag); - registerGesture(tag, gesture); + bindSharedValues(config, handlerTag); + registerGesture(handlerTag, gesture); return () => { - unbindSharedValues(config, tag); - unregisterGesture(tag); + unbindSharedValues(config, handlerTag); + unregisterGesture(handlerTag); }; - }, [tag, config, type, gesture]); + }, [handlerTag, config, type, gesture]); return gesture; } diff --git a/packages/react-native-gesture-handler/src/v3/hooks/utils/relationUtils.ts b/packages/react-native-gesture-handler/src/v3/hooks/utils/relationUtils.ts index e815c37299..c893eb20d9 100644 --- a/packages/react-native-gesture-handler/src/v3/hooks/utils/relationUtils.ts +++ b/packages/react-native-gesture-handler/src/v3/hooks/utils/relationUtils.ts @@ -8,7 +8,7 @@ import { export function isComposedGesture( gesture: Gesture | ComposedGesture ): gesture is ComposedGesture { - return 'tags' in gesture; + return 'handlerTags' in gesture; } function extractHandlerTags( @@ -22,12 +22,12 @@ function extractHandlerTags( if (Array.isArray(otherHandler)) { otherTags = otherHandler.flatMap((gesture: Gesture) => - isComposedGesture(gesture) ? gesture.tags : gesture.tag + isComposedGesture(gesture) ? gesture.handlerTags : [gesture.handlerTag] ); } else { otherTags = isComposedGesture(otherHandler) - ? otherHandler.tags - : [otherHandler.tag]; + ? otherHandler.handlerTags + : [otherHandler.handlerTag]; } return otherTags; diff --git a/packages/react-native-gesture-handler/src/v3/types/GestureTypes.ts b/packages/react-native-gesture-handler/src/v3/types/GestureTypes.ts index 5673c4c789..ba83883530 100644 --- a/packages/react-native-gesture-handler/src/v3/types/GestureTypes.ts +++ b/packages/react-native-gesture-handler/src/v3/types/GestureTypes.ts @@ -28,7 +28,7 @@ export type BaseDiscreteGestureConfig = Omit< >; export type SingleGesture = { - tag: number; + handlerTag: number; type: SingleGestureName; config: BaseGestureConfig; detectorCallbacks: DetectorCallbacks; @@ -42,7 +42,7 @@ export type DiscreteSingleGesture = { }; export type ComposedGesture = { - tags: number[]; + handlerTags: number[]; type: ComposedGestureName; config: ComposedGestureConfig; detectorCallbacks: DetectorCallbacks;