I followed to the newest RNGH docs
I can't get the double tap event to work, seems like RNGH only recognize the event with less tap
(I changed the numberOfTaps
of const singleTap
to 3 and the doubleTap
worked)
I tried to change the order of Exclusive (not working)
Using old RNGH 1.10.3 like this video
https://www.youtube.com/watch?v=nbEmo0zLJjw&list=PLjHsmVtnAr9TWoMAh-3QMiP7bPUqPFuFZ&index=6
But none of these methods are worked
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>