First opened screen doesn't substitute default one

This commit is contained in:
Volodymyr Kozieiev 2019-06-26 11:47:59 +03:00 committed by GitHub
parent 5977354279
commit f166627a8d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -61,19 +61,6 @@ function createTwoPaneNavigator(routeConfigMap, navigationConfig) {
const defaultGetStateForAction = router.getStateForAction;
router.getStateForAction = (action: any, state: any) => {
if (action.type === NavigationActions.NAVIGATE &&
state.routes[state.index].routeName == navigationConfig.initialRouteName &&
action.routeName in routeConfigMap) {
const resetAction = StackActions.reset({
index: 0,
actions: [NavigationActions.navigate({routeName: action.routeName, params: action.params})],
});
return defaultGetStateForAction(resetAction, state);
}
return defaultGetStateForAction(action, state);
};