这是我遇到的错误,请帮忙。我通过互联网查询,却找不到任何东西
./src/productsection.js Attempted import error: 'bindActionCreaters' is not exported from 'redux'.
import React from 'react';
import { connect } from 'react-redux';
import { bindActionCreaters } from 'redux';
function Products({users}) {
function displayitem(){
return users.map((user) => {
return (
<button onClick={()=>users.selectUser(user)}>Add to cart </button>
</div>
);
});
}
return (
<div>
{ displayitem() }
</div>
);
}
function mapStatetoProps(state){
return {
users: state.users ,
};
}
function mapDispatchToProps(dispatch) {
return bindActionCreaters({ selectUser: selectUser }, dispatch);
}
export default connect(mapStatetoProps, mapDispatchToProps)(Products);
答案 0 :(得分:0)
将bindActionCreaters重命名为bindActionCreators