Skip to content

Commit 84ce977

Browse files
committed
Update virtual detector
1 parent ee95538 commit 84ce977

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

packages/react-native-gesture-handler/src/v3/detectors/VirtualDetector/VirtualDetector.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
useInterceptingDetectorContext,
77
} from './useInterceptingDetectorContext';
88
import { isComposedGesture } from '../../hooks/utils/relationUtils';
9-
import { NativeDetectorProps } from '../common';
9+
import { VirtualDetectorProps } from '../common';
1010
import { configureRelations } from '../utils';
1111
import { tagMessage } from '../../../utils';
1212
import { DetectorCallbacks, VirtualChild } from '../../types';
@@ -24,7 +24,7 @@ function useRequiredInterceptingDetectorContext() {
2424
}
2525

2626
export function VirtualDetector<THandlerData, TConfig>(
27-
props: NativeDetectorProps<THandlerData, TConfig>
27+
props: VirtualDetectorProps<THandlerData, TConfig>
2828
) {
2929
// Don't memoize virtual detectors to be able to listen to changes in children
3030
// TODO: replace with MutationObserver when it rolls out in React Native

packages/react-native-gesture-handler/src/v3/detectors/common.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ export interface InterceptingGestureDetectorProps<THandlerData, TConfig>
2828
gesture?: Gesture<THandlerData, TConfig>;
2929
}
3030

31+
// TODO: Handle CommonGestureDetectorProps inside VirtualGestureDetector
32+
export interface VirtualDetectorProps<THandlerData, TConfig> {
33+
children?: React.ReactNode;
34+
gesture: Gesture<THandlerData, TConfig>;
35+
}
36+
3137
export type GestureDetectorProps<THandlerData, TConfig> =
3238
| NativeDetectorProps<THandlerData, TConfig>
3339
| InterceptingGestureDetectorProps<THandlerData, TConfig>

0 commit comments

Comments
 (0)