Expo Router add index page into stack
We had a situation that we wanted to guarantee that an "index" page under a tab navigation was always there, this way we could go back using the navigation to the index page, even if the user entered to that tab navigation via another screen. I learned that we can use withAnchor
prop in conjunction with the unstable settings initialRouteName
. This worked really fine and now our back buttons always go to each tab's index screens.
Check this out Expo Router navigation patterns
Tweet