react-native redux获取一个bizzare未处理的Promise拒绝(id:0)警告

时间:2018-03-26 14:03:37

标签: react-native redux redux-thunk

我正在使用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;
    }
}

第一个console.log没有显示此enter image description here

我在尝试访问 action.payload 时只收到错误

在第二个console.log语句中。

1 个答案:

答案 0 :(得分:0)

当它应该是actions.payload时,我正在调用action.payload。 感谢@azium指出它