diff --git a/src/Reducer.js b/src/Reducer.js index 0b57f2848..dbba76dc5 100644 --- a/src/Reducer.js +++ b/src/Reducer.js @@ -52,16 +52,13 @@ export function reducer(state = navigationStore.state, action) { let newState = state; let currentState = state; const initialState = navigationStore.router.getStateForAction(NavigationActions.popToTop(), currentState); - while (newState && nextScene !== routeName) { + while (newState && nextScene !== routeName && !isEqual(newState, initialState)) { newState = navigationStore.router.getStateForAction(NavigationActions.back(), currentState); if (newState) { nextScene = getActiveState(newState).routeName; if (nextScene !== routeName) { currentState = newState; } - if (isEqual(currentState, initialState)) { - break; - } } } return nextScene === routeName ? newState : state;