I want the initial screen of our app to be a stack of 2 screens.
So imagine a StackNavigator with two screens
  • ScreenA
  • ScreenB
I want the initial route to be ScreenB but have ScreenA on the stack of routes on initial load.
I know we can use the initialState from NavigationContainer but that's fairly complex to generate the state for the navigator and its parents. It also has some serious pitfalls: https://reactnavigation.org/docs/state-persistence/#warning-serializable-state
What if the stack navigator could have a prop where you can pass the stack history in which you wanted on initial load:
initialRoutes={["ScreenA", "ScreenB"]}
initialHistory={["ScreenA", "ScreenB"]}
In my opinion this would really simplify the API and prevent developers from running into the pitfalls.