diff --git a/src/reducers/view/view.js b/src/reducers/view/view.js index 6e5ba51ef..ec51131b6 100644 --- a/src/reducers/view/view.js +++ b/src/reducers/view/view.js @@ -196,15 +196,18 @@ export function collapseRow(state, action) { export function expandRow(state, action) { const { expandedRows } = state; const item = action.value; + let newState; if (!expandedRows.includes(item)) { - expandedRows.push(item); + newState = { + ...state, + expandedRows: [...expandedRows, item], + }; + } else { + newState = { ...state }; } - return { - ...state, - expandedRows, - }; + return newState; } /**