Search code examples
react-nativereact-navigationgesture

React-Navigation increase swipe back area


I am using the React-Navigation lib for my current project and dont like the swipe back function. It only gets triggered if you place your finger at the total edge of the screen for the gesture to swipe back. I have read the API Reference but could not found anything towards my problem with the behaviour.


Solution

  • You can increase swipe back area with this:

    const stack = createStackNavigator({
       Home,
       ...
    }, {
       ...
       navigationOptions: {
          gestureResponseDistance: {horizontal: 100} // default is 25
       }
    })