Home > Mobile >  React Native onPressOut
React Native onPressOut

Time:11-27

I am using react-native. I want to trigger the function when the user releases the screen. However, onPressOut fires even if the user drags the finger. Is there any simple way that I can detect the timing when the user releases their finger?

 onPressIn={() => {
        console.warn('Pressed!');
      }}
      onPressOut={() => {
        console.warn('Released');
      }}

CodePudding user response:

onPressOut will be called the moment you drag something even if the user still touching the screen.

You should check onPanResponderRelease, it will trigger when the user releases the touch after dragging. Documentation here

  • Related