mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-05-08 02:48:47 +08:00
feat: handle route names change
This commit is contained in:
committed by
Satyajit Sahoo
parent
95773de0a3
commit
b775dbaacf
@@ -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':
|
||||
|
||||
Reference in New Issue
Block a user