As the title of the question says, I want to activate the PanGestureHandler
after a long press delay let's say a second (1000 ms) so I tried some workarounds mentioned here: https://github.com/software-mansion/react-native-gesture-handler/discussions/434 but didn't work, the LongPressGestureHandler
doesn't work as expected, the pan gesture fires immediately (as in the normal case).
Following is the code I tried:
const Component = () => {
const longPressRef = useRef();
return (
<LongPressGestureHandler minDurationMs={800} ref={longPressRef}>
<Animated.View style={StyleSheet.absoluteFill}>
<PanGestureHandler
waitFor={longPressRef}
minDist={0}
{...gestureHandler}
>
<Animated.View style={StyleSheet.absoluteFill}>
...
</Animated.View>
</PanGestureHandler>
</Animated.View>
</LongPressGestureHandler>
);
}
Package.json:
"react-native-gesture-handler": "~2.1.0",
"react-native-reanimated": "~2.3.1",
"react-native-redash": "^16.2.3",
What could be a possible solution for this?