Accepted answer

You can use Array.slice which returns a shallow copy of your original array minus the sliced items. DO NOT use shift() which actually mutates your state and can cause all sorts of issues.

return [...state.slice(1),]


Array#shift returns the shifted value, not the array with the value removed (it shifts it in-place).

You can do

[ ...state, action.payload.steam ] 

although I'm pretty sure Redux docs specify that you should avoid acting on the state directly...

Related Query

More Query from same tag