Mohamed Ahmed
Mohamed Ahmed

Reputation: 347

Problem with gestureResponseDistance in react-navigation v6

I am using gestureResponseDistance to increase the swipe back area, but it's not working, and it shows me No overload matches this call.

<HomeStack.Navigator
      screenOptions={{
        gestureResponseDistance: {vertical: 200, horizontal: 150},
      }}>
      <HomeStack.Screen
        options={{
          headerTitle: 'Home',
          headerStyle: styles.header,
          headerTitleStyle: styles.headerTitle,
        }}
        name="HomeScreen"
        component={HomeScreen}
      />
      //...........

</HomeStack.Navigator>

enter image description here

any clue what's the problem? or maybe solutions?

Upvotes: 1

Views: 596

Answers (1)

satya164
satya164

Reputation: 10145

gestureResponseDistance accepts a number in 5.x, not an object.

https://reactnavigation.org/docs/upgrading-from-5.x/#the-gestureresponsedistance-option-is-now-a-number-instead-of-an-object

But I also see you're using createNativeStackNavigator which doesn't have this option. Only createStackNavigator supports gestureResponseDistance.

Upvotes: 3

Related Questions