feat: handle route names change

This commit is contained in:
satyajit.happy
2019-07-16 15:41:16 +02:00
committed by Satyajit Sahoo
parent 95773de0a3
commit b775dbaacf
5 changed files with 110 additions and 6 deletions

View File

@@ -88,6 +88,14 @@ const StackRouter: Router<CommonAction | Action> = {
return state;
},
getStateForRouteNamesChange(state, { routeNames }) {
return {
...state,
routeNames,
routes: state.routes.filter(route => routeNames.includes(route.name)),
};
},
getStateForAction(state, action) {
switch (action.type) {
case 'PUSH':