Expo Router - Back button disappears when switching between tabs in tab navigator

252 Views Asked by At

I would like to illustrate a problem I have encountered nesting stack navigators inside tab navigators with expo router.

image

The above is what I believe to be a very common app layout. It is a stack navigator that contains some children (in this case, a modal and a tab navigator). The tab navigator in turn contains two other stack navigators, in this example "Cupboards" and "Shelves".

When I navigate into the actual cupboards and shelves screens, I very soon cannot obtain a back button and get stuck at the deepest level of the stacks. See video below. I am fairly certain I have followed all the correct setup protocol. My code is here. I used the suggested setup of npx create-expo-app@latest --template tabs@49 and modified it to created the above.

https://github.com/expo/router/assets/2414383/498aa233-ce57-4267-841e-9fee25e5a6ff

Is this the expected behaviour of expo router? I think this one reason why people are asking for a reset function (see discussion here). I am considering moving back to react navigation, but am praying I am wrong about something here as I really like file-based navigation.

0

There are 0 best solutions below