How do I add elements in my array arr[] of redux state in reducer? I am doing this-
arr[]
import {ADD_ITEM} from \'../Actions/UserActions\' const ini
If you need to insert into a specific position in the array, you can do this:
case ADD_ITEM : return { ...state, arr: [ ...state.arr.slice(0, action.pos), action.newItem, ...state.arr.slice(action.pos), ], }