Answers for "redux append to an array"

5

redux append to an array

case ADD_ITEM :
    return { 
        ...state,
        arr: [...state.arr, action.newItem]
    }
Posted by: Guest on February-18-2020
0

how to append a data to list in redux

case ADD_ITEM :
    return { 
        ...state,
        arr: [...state.arr, action.newItem]
    }
OR

case ADD_ITEM :
    return { 
        ...state,
        arr: state.arr.concat(action.newItem)
    }
Posted by: Guest on May-01-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language