a) User navigates to some screen B in app. Backgrounds the app.
b) User opens app --> app always opens to initialRouteName (Loading --> first screen in Tab Navigator "Screen A"). This is unexpected since was previously using on Screen B.
Similarly, when opening the app from a notification, the Loading route is called, which then directs to TabNavigator first screen. I think I could store navigation history, then check for prior screen state if opening from foreground in the "Loading" screen. For the notification case, I could store notification params on tap, then pull notification parameters from storage to direct user to that specific page. This seems super cumbersome, and I wonder if there is a better way.
//Navigator
const SwitchNavigator = createSwitchNavigator(
{
TabNavigator,
Auth,
Loading
},
{
initialRouteName: "Loading"
}
);
//Loading.js
componentDidMount() {
signedIn ? this.props.navigation.navigate(TabNavigator)
: this.props.navigation.navigate(Auth)
}