I have a Carousel inside a ScrollView, and I wanted to know where the user clicked on the Carousel item. I did this thanks to @ Alexander Netsov.
this._panResponder = PanResponder.create({ onStartShouldSetPanResponder: () => true, onMoveShouldSetPanResponder: () => false, onPanResponderGrant: (e, gestureState) => { this.onLongPressTimeout = setTimeout(() => { console.log("ON LONG PRESS", gestureState); }, LONG_PRESS_DELAY); }, onPanResponderRelease: () => { clearTimeout(this.onLongPressTimeout); }, onPanResponderTerminate: () => { clearTimeout(this.onLongPressTimeout); }, onShouldBlockNativeResponder: () => false, onPanResponderTerminationRequest: () => true });
Vertical ScrollView , horizontal Carousel and PanResponder all work perfectly on Android.
Note: it has not been tested on iOS
source share