score:2

Accepted answer

the only required property of an action is type, every other property is arbitrary. as long as your reducer knows how to deal with it you can dispatch pretty much anything (including components).

dispatch({
    type: 'my_action',
    data: {
        arr: [],
        str: 'foo',
    }
})

const reducer = (state = initialstate, action) =>{
    switch(action.type){
        case 'my_action' return {
            ...state,
            myarr : action.data.arr
        }

        default : return state
    }
}

Related Query

More Query from same tag