From 667822809cea0014516e040d7a9a75c01e403231 Mon Sep 17 00:00:00 2001 From: Tien Pham <32733132+tienf4m@users.noreply.github.com> Date: Fri, 12 Oct 2018 03:49:48 +0700 Subject: [PATCH] Fix unexpected route switching after the transition is complete (#5113) --- packages/react-navigation/src/routers/StackRouter.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/react-navigation/src/routers/StackRouter.js b/packages/react-navigation/src/routers/StackRouter.js index ae8ec1d4..799569e8 100644 --- a/packages/react-navigation/src/routers/StackRouter.js +++ b/packages/react-navigation/src/routers/StackRouter.js @@ -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 ); } }