-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Implement gesture relations #3664
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
packages/react-native-gesture-handler/src/v3/hooks/relations/useExclusive.ts
Outdated
Show resolved
Hide resolved
packages/react-native-gesture-handler/src/v3/NativeDetector.tsx
Outdated
Show resolved
Hide resolved
packages/react-native-gesture-handler/src/v3/NativeDetector.tsx
Outdated
Show resolved
Hide resolved
export const SingleGestureType = { | ||
Tap: 'TapGestureHandler', | ||
LongPress: 'LongPressGestureHandler', | ||
Pan: 'PanGestureHandler', | ||
Pinch: 'PinchGestureHandler', | ||
Rotation: 'RotationGestureHandler', | ||
Fling: 'FlingGestureHandler', | ||
Manual: 'ManualGestureHandler', | ||
Native: 'NativeGestureHandler', | ||
} as const; | ||
|
||
export const ComposedGestureType = { | ||
Simultaneous: 'SimultaneousGesture', | ||
Exclusive: 'ExclusiveGesture', | ||
Race: 'RaceGesture', | ||
} as const; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These could also use a different name, Type
suffix is a bit misleading.
export function useGesture( | ||
type: GestureType, | ||
type: ValueOf<typeof HandlerType>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a scenario where this is ComposedGestureType
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think so, good catch.
import { ComposedGesture, ComposedGestureType, NativeGesture } from '../types'; | ||
|
||
// The tree consists of ComposedGestures and NativeGestures. NativeGestures are always leaf nodes. | ||
export const dfs = ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could also use a more descriptive name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I know, I left it for now as there are some other things to do 😅
Caution
|
I think the word you're looking for is |
On hold
Caution
Warning
Reanimated
fromJS
#3682 to be mergedDescription
Test plan
For simultaneous:
For Exclusive:
For Race:
For composed: