Closed LunatiqueCoder closed 1 year ago
We firstly implemented react-native-reanimated
with the goal of changing as little source code as possible. You can see a video here: https://x.com/LunatiqueCoder/status/1721982083902394694?s=20
Then when we also upgraded gesture-handler
we ran into this issue: https://github.com/software-mansion/react-native-gesture-handler/issues/2674 so we decided to isolate the changes related to gesture-handler
in order to create a reproduction repository. However, upon further investigation, we realised there's a possibility of fixing this issue on our end as gesture-handler
is designed to function more seamlessly with reanimated
than standalone. Ugh, this is going to be fun. Closing this in favour of another upcoming reanimated
PR.
Solves #140
While it works very well with LunatiqueCoder/expo-drax-example (which is forked from: nuclearpasta/react-native-drax-example) , we managed to reproduce in production this particular issue: https://github.com/software-mansion/react-native-gesture-handler/issues/2674.
As described in the above link and also in #165, this happens when there are a lot of
GestureDetectors
from the newgesture-handler
API. Reducing the number ofGestureDetectors
(orDraxViews
in our case) will make the issue less annoying or even very hard to reproduce.I believe this should stay as a draft until we manage to fix it OR we can try to have a
useLegacyGestureHandler
prop.While I also had to add some type guards, here are the actual changes:
LongPressGestureHandler
withGestureDetector
: https://github.com/nuclearpasta/react-native-drax/pull/166/files#diff-ca36f9b9f717cdebf5e5026d070d332a5013a2d79129fdd8bbf91cf189a360daR341-R600