-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Closed
Labels
Description
Current Behavior
Current behavior: when opening a screen inside a sub stack navigator it always renders the first screen or the screen specified as initialRouteName
. That makes sense for a top-level navigator, but it makes some things rather difficult for sub navigators.
Code example is here: https://snack.expo.io/H1Mgdt3MS
I have 3 screens:
- MainScreen
- ScreenA (modal)
- ScreenB (modal on the same level as ScreenA)
I don't want react-navigation to render any routes inside the modal stack unless I tell it to. Two reasons for this:
- the screens inside the sub stack navigator requires params in order to work
- I don't want a history entry in my app for the first screen (see the second gif below, where the back button should go to MainScreen)
Expected Behavior
There would be a way to bypass rendering the first screen in a child stack navigator. Setting initialRouteName
to null
would be logical to me.
How to reproduce
https://snack.expo.io/H1Mgdt3MS
Your Environment
software | version |
---|---|
react-navigation | 3.11.1 |
react-native | 0.59.10 |
node | node 10, 11 and 12 |
npm or yarn | yarn |
todorone, Nicosan-K, TeChn4K, KolenkoJan, wannesco and 1 more