web: useAnimatedGestureHandler not working
See original GitHub issueDescription
That is working on android, but on the web the gesture event is not called
Screenshots
Steps To Reproduce
const gestureHandler = useAnimatedGestureHandler(
{
onStart: (_, ctx: any) => {
//notCalled
},
onActive: (event, ctx) => {
//notCalled
},
onEnd: (_) => {
//notCalled
},
},
[],
);
Expected behavior
Actual behavior
Snack or minimal code example
Package versions
- React: 17.0.1
- React Native: 0.63.1
- React Native Reanimated: 2.0.0-alpha.8
- React Native Gesture Handler: 1.8.0
- NodeJS: 12
Issue Analytics
- State:
- Created 3 years ago
- Reactions:5
- Comments:13 (11 by maintainers)
Top Results From Across the Web
Developers - web: useAnimatedGestureHandler not working -
Description. That is working on android, but on the web the gesture event is not called. Screenshots. Steps To Reproduce.
Read more >React Native Gesture Handler Not Working On Android
Everything works fine when I launch the app on the web but on android I get no feedback. I used snack to text...
Read more >useAnimatedGestureHandler | React Native Reanimated
This hook allows for defining worklet handlers that can serve in a process of handling gestures. Before you can use the hook, make...
Read more >Events | React Native Reanimated
const eventHandler = useAnimatedGestureHandler({ ... PanGestureHandler not only reports down and up events (that we subscribed to with onStart and onEnd ...
Read more >Reanimated 2 - new approach to creating animations in React ...
Working with the new API is quite a pleasure and a new hooks set is ... Reanimated 2 provides us with a hook...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@ElForastero thanks, I will reopen the issue and soon push the fix 🙌
@karol-bisztyga
Well, I finally made it working on both iOS and Web by manually defining handlers for PanGestureHandler.
useAnimatedGestureHandler
works well in native but seems like does absolutely nothing in web environment. Spend a while trying to understand the source of the problem, but with no success.“react”: “16.13.1”, “react-native”: “0.63.3”, “react-native-web”: “^0.14.7” “react-native-gesture-handler”: “^1.9.0”, “react-native-reanimated”: “^2.0.0-rc.0”,
UPD:
It looks like the issue is because of this.
WorkletEventHandler
is being passed into RNGH instead of regular listener. 🤔