mirror of
https://github.com/status-im/react-native-navigation-twopane.git
synced 2025-02-21 05:58:30 +00:00
First opened screen doesn't substitute default one
This commit is contained in:
parent
5977354279
commit
f166627a8d
13
index.js
13
index.js
@ -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);
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user