Skip to content

Commit 21a3149

Browse files
update reducer : action.active did
not return new state because React.StrictMode causes setState to fire twice.
1 parent 4e6ea9b commit 21a3149

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/utils/stateManagement/reducer.js

+2-4
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,8 @@ export default function reducer(state, action) {
2525
case actions.active:
2626
{
2727
const tabId = action.tabId;
28-
if (state.selectedTabID !== tabId) {
29-
state.selectedTabID = tabId;
30-
return helper.getCopyState(state);
31-
}
28+
if (state.selectedTabID !== tabId)
29+
return { selectedTabID: tabId, openTabIDs: state.openTabIDs };
3230
return state;
3331
}
3432

0 commit comments

Comments
 (0)