这就是我连接到registeruser redux的方式 我想连接到另一个redux
注册人将数据发送到API在第二个redux中,我想从API获取任务,但是当我尝试连接另一个redux时,它是给我这个错误
连接组件
时,mapstatetoprops的类型对象的无效值 const mapStateToProps = state => {
return {
errorid: state.RegisterR.errorid,
loading: state.RegisterR.loading,
registersucsess:state.RegisterR.registersucsess
}}
export default connect(mapStateToProps, { RegisterUser })(Register);
what i try to do something like this const mapStateToProps = state => {
return {
errorid: state.RegisterR.errorid,
loading: state.RegisterR.loading,
registersucsess:state.RegisterR.registersucsess,
data: state.taskList.data}}
export default connect(mapStateToProps, {fetchTasks},{ RegisterUser })(Register);
谢谢大家我有一家商店
我从'redux'';
组合了我的还原器导入{combinereducers}我想在同一屏幕上使用两个动作
我设法这样做
const mapStateToProps = state => {
return {
errorid: state.RegisterR.errorid,
loading: state.RegisterR.loading,
registersucsess:state.RegisterR.registersucsess,
data: state.taskList.data // this is for fetchTasks }}
export default connect(mapStateToProps, { RegisterUser ,fetchTasks})(Register);