question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Any ETA for support of nested touch handlers with native driver?

See original GitHub issue

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:

Nesting touch handlers with native animated driver is not supported yet
...

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.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

32reactions
kmagieracommented, Dec 13, 2017

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:

<PinchHandler ...>
   <RotationHandler ...>
      <Animated.View ... />
   </RotationHandler>
</PinchHandler>

you should do:

<PinchHandler ...>
  <Animated.View ... >
     <RotationHandler ...>
        <Animated.View ... />
     </RotationHandler>
   </Animated.View>
</PinchHandler>

If you’re using native driver remember that the child should be an “Animated” component (e.g. Animated.View vs just View)

5reactions
kmagieracommented, Dec 13, 2017

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Any ETA for support of nested touch handlers with native driver?
I tried running one of the examples (rotate+pinch) with native driver set to true , but get the following error: Nesting touch handlers...
Read more >
About Gesture Handlers | React Native ... - Software Mansion
Handlers analyze touch stream synchronously in the UI thread. This allows for uninterrupted interactions even when the Javascript thread is blocked. Each ...
Read more >
How to use nested Touchables with react native gesture handler
I'm trying to change all my Touchables to react native gesture handler, but when I have some nested Touchables it just doesn't work...
Read more >
Synchronize user and group details with Google Cloud Directory
I do completely understand how nested groups makes the maintenance of permissions and memberships that much easier. Although we still don't support native...
Read more >
1. fio - Flexible I/O tester rev. 3.32 - FIO's documentation!
Include directives may be nested in that any included file may contain further include directive(s). Include files may not contain [] sections. 1.12.1....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found