onLongPress covers long presses. A double tap has no prop, so build it from onPress with a timer: the first tap starts a 300 ms wait, and a second tap inside it cancels the single-tap action. The book cover's Pressable passes the hook's result as onPress and logs a quick look from onLongPress after delayLongPress={400}:
function useTaps({ onSingle, onDouble, delay = 300 }) {
const timer = useRef(null);
return () => {
if (timer.current) {
clearTimeout(timer.current);
timer.current = null;
onDouble();
} else {
timer.current = setTimeout(() => { timer.current = null; onSingle(); }, delay);
}
};
}A tap, two quick taps (two input tap commands in one adb shell call) and a 1-second hold logged:
LOG single tap: open book LOG double tap: like book LOG long press: quick look
Every single tap now waits 300 ms, so use double tap only where that delay is acceptable. React Native Gesture Handler 3 6,788 offers useTapGesture({ numberOfTaps: 2 }) on the native thread (Reanimated and Gesture Handler).