-
-
Notifications
You must be signed in to change notification settings - Fork 955
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
Any ETA for support of nested touch handlers with native driver? #71
Comments
Hey @jhalborg thanks for reaching out about this issue. So in general nesting touch handlers is supported from day 1. I think this warning may be a bit misleading. What is not supported ATM is having nested handlers as direct children. Supporting this will require upstream changes and is not currently on my roadmap. But you can still nest handlers with native event as long as their direct child is a RN component (e.g. View). So instead of doing:
you should do:
If you're using native driver remember that the child should be an "Animated" component (e.g. Animated.View vs just View) |
@kmagiera - Thanks for getting back to me :) I think you misunderstood, I wasn't clear enough. It wasn't nesting of handlers with native events, but nesting of handlers with I tried running the example "scaleAndRotate" from here, where the handlers are nested like
Then I commented out the But maybe it was because of the plain non-animated |
I did understand that correctly and I’m aware of this issue. As mentioned in my previous comment, you could put Animated.View in between each handler and that should do. Also whenever you use native driver it should have an Animated element as a direct child |
Thanks again. I'm sorry, it seems I misunderstood, not you ;) I tested it real quick, and it seems to build without the redbox if I insert an On a sidenote, I realize now when reading it again how arrogant i sounds starting out with "I think you misunderstood", my apologies :-) |
If for some reason you want multiple nested elements but don't want to put <Animated.View>'s inbetween them, you can create Animated ghost elements:
This could be useful if putting elements inbetween complicates your layout. |
- Added Animated.View in between handlers. software-mansion/react-native-gesture-handler#71
Hey,
Thanks for a great lib, it's got a lot of potential to be the de facto library for gesture handling, especially for Expo projects!
One question. I tried running one of the examples (rotate+pinch) with native driver set to
true
, but get the following error:Any ETA on when this is supported? That would make this library near perfect :-) But until then, there's no big difference between just implementing it using the core handlers and using this.
The text was updated successfully, but these errors were encountered: