【发布时间】:2020-03-31 21:32:27
【问题描述】:
我得到的错误如下:
Error: Invalid value of type object for mergeProps argument when connecting component Majregion.
我是 redux 新手,尝试过各种不同的方法。
Majregion.propTypes = {
addRegionMaj : PropTypes.func.isRequired,
errors : PropTypes.object.isRequired
}
const mapStateToProps = state =>({
errors : state.errors,
Region : state.Region,
})
export default connect (mapStateToProps,{getBackLog} ,{addRegionMaj}) (Majregion);
export const getBackLog = () => async dispatch => {
const res = await axios.get("http://localhost:8080/regions/all")
dispatch ({
type : GET_MODELS_REGION,
payload : res.data
});
};
注意:一切正常,就在我在导出默认连接中添加方法 {getBackLog} 时 请问我该怎么办
【问题讨论】:
标签: reactjs redux react-redux state