我正在使用redux-thunk
我将客户详细信息发布到数据库,然后将响应作为有效负载发送
这是我的CustomerReducers
export default (state = intial_state ,actions) => {
console.log('customer action',actions); //1
switch(actions.type) {
case CUSTOMER_SAVE_SUCCESS:
console.log('cus success',action.payload); //2
return {
...state,
emailError:false ,
contactError:false,
name:'',
email: '',
address:'',
contact: '',
loading:false
};
default: return state;
}
}
我在尝试访问 action.payload 时只收到错误
在第二个console.log语句中。
答案 0 :(得分:0)
当它应该是actions.payload时,我正在调用action.payload。 感谢@azium指出它