From b0bd50e9defbbe7134a3ded0be4befd711d90fb7 Mon Sep 17 00:00:00 2001 From: James Lin Date: Wed, 25 Oct 2017 22:58:18 +0800 Subject: [PATCH] fix redirect bug in stacks in tab (#2674) --- packages/react-navigation/src/routers/TabRouter.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/react-navigation/src/routers/TabRouter.js b/packages/react-navigation/src/routers/TabRouter.js index 3bb29fe0..c366460f 100644 --- a/packages/react-navigation/src/routers/TabRouter.js +++ b/packages/react-navigation/src/routers/TabRouter.js @@ -239,6 +239,10 @@ export default ( }); // console.log(`${order.join('-')}: Processed other tabs:`, {lastIndex: state.index, index}); + // keep active tab index if action type is SET_PARAMS + index = + action.type === NavigationActions.SET_PARAMS ? state.index : index; + if (index !== state.index || routes !== state.routes) { return { ...state,