Fix unexpected route switching after the transition is complete (#5113)

This commit is contained in:
Tien Pham
2018-10-12 03:49:48 +07:00
parent e4b9bd452c
commit 667822809c

View File

@@ -543,8 +543,10 @@ export default (routeConfigs, stackConfig = {}) => {
state,
childRoute.key,
route,
// the following tells replaceAt to NOT change the index to this route for the setParam action, because people don't expect param-setting actions to switch the active route
action.type === NavigationActions.SET_PARAMS
// the following tells replaceAt to NOT change the index to this route for the setParam action or complete transition action,
// because people don't expect these actions to switch the active route
action.type === NavigationActions.SET_PARAMS ||
action.type === StackActions.COMPLETE_TRANSITION
);
}
}