I recently checked out the latest documentation for RNGH here
Struggling with getting the double tap event to trigger, it seems like RNGH only registers events with fewer taps
(I modified the numberOfTaps
in the const singleTap
to 3 and then the doubleTap
started working)
I even attempted changing the Exclusive order (no luck)
Tried replicating an older version of RNGH 1.10.3 as shown in this video
https://www.youtube.com/watch?v=nbEmo0zLJjw&list=PLjHsmVtnAr9TWoMAh-3QMiP7bPUqPFuFZ&index=6
But unfortunately, none of these methods seemed to do the trick
Gesture:
const singleTap = Gesture.Tap().onEnd((_event, success) => {
if (success) {
console.log("single tap!");
}
});
const doubleTap = Gesture.Tap()
.numberOfTaps(2)
.onEnd((_event, success) => {
if (success) {
console.log("double tap!");
}
});
const taps = Gesture.Exclusive(doubleTap, singleTap);
Component:
<View style={styles.container}>
<GestureDetector gesture={taps}>
<Animated.View>
<ImageBackground
source={require("./assets/image.jpg")}
style={styles.image}
>
<Image
source={require("./assets/heart.png")}
style={[
styles.image,
{
shadowOffset: { width: 0, height: 20 },
shadowOpacity: 0.35,
shadowRadius: 35,
},
]}
resizeMode={"center"}
/>
</ImageBackground>
</Animated.View>
</GestureDetector>
</View>