useAnimatedGestureHandler and <GestureDetector> ? #4344
Unanswered
JS-GitRepo
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Yeah we really, really need better docs on the new Gesture API. IDK if there are even complete docs for it. The new api is something like this: const gesture = useMemo(() => {
return Gesture.Pan().onUpdate(event=>{/* do something */})
}, []);
return (
<GestureDetector gesture={gesture} />
) The new API is way nicer to use. The hooks aren't necessary anymore |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
The React Native Gesture Handler docs advise against the pattern listed in the Reanimated docs here, suggesting the use of "GestureDetector" instead of "TapGestureHandler". The issue is that the required prop for GestureDetector, "gesture={}" does not accept useAnimatedGestureHandler() as an input. useAnimatedGestureHandler()'s type is infered as "OnGestureEvent-PanGestureHandlerGestureEvent-". In summary, is this hook now deprecated?
The docs are very lacking when it comes to using GestureDetector with Reanimated. Any insight here? Thank you for your time.
Beta Was this translation helpful? Give feedback.
All reactions