Rahul Jain
Rahul Jain

Reputation: 107

Incorrect back behaviour in Stack Navigator inside Tab Navigator

I have nested a Stack Navigator containing multiple screens in Top Tab Navigator. When inside stack navigator, back swipe gesture instead of navigating within Stack screens navigates to previous screen of top Tabs. Navigation Structure:

Top Tabs:
  Screen 1: Botton Navigator
  Screen 2: Stack Navigator:
    Screen 2.1
    Screen 2.2

I require navigation from 2.1 to 2.2 then when I do back swipe gesture I want to navigate back to 2.1 but it navigates to Screen 1. When I am at screen 2.2 shouldn't the current or child navigator i.e. Stack navigator handle back gesture. Can someone please help regarding this.

Upvotes: 0

Views: 752

Answers (1)

Rahul Jain
Rahul Jain

Reputation: 107

Finally was able to resolve it. Child navigator takes care of the gesture but the gesture area of stack navigator was set to default value = 25 which was more than swipe area of Top Tab Navigator. Increasing gestureResponseDistance in stack navigator screen options did the job for me.

Upvotes: 0

Related Questions