In the android emulator, the following RN code does nothing (no log, no handler called)
<Pressable style={[styles.fullscreenContainer]}
onPressIn={()=> {console.log("onPress");this.props.touchHandler()}}>
However, if I insert a onPress
handler, in otherwise exactly the same code, both logs appear and both handlers are called when the component is pressed.
<Pressable style={[styles.fullscreenContainer]}
onPress= {()=> {console.log("onPress"); this.props.touchHandler()}}
onPressIn={()=> {console.log("onPressIn");this.props.touchHandler()}}>
Why does onPressIn
not work on its own?
FYI onPressIn
works correctly on iOS in the expo client