Redux 已调用操作创建者,但未调度操作

Redux 已调用操作创建者,但未调度操作,redux,react-redux,redux-form,Redux,React Redux,Redux Form,我有一个组件成功地使用redux表单onSubmit调用动作创建者。创建者执行ajax调用,但从未调度该操作以将其保存到存储。我一定是在react-redux和redux表单的连接中弄乱了什么,可能是在动作创建者的绑定中。我已经阅读了在谷歌上找到的所有内容,但仍然找不到问题所在。有什么想法吗?(我已经加入了redux承诺来处理请求承诺,但它从未做到这一点) 从“React”导入React; 从“redux form”导入{Field,reduxForm}; 从“../utils/add_pers

我有一个组件成功地使用redux表单onSubmit调用动作创建者。创建者执行ajax调用,但从未调度该操作以将其保存到存储。我一定是在react-redux和redux表单的连接中弄乱了什么,可能是在动作创建者的绑定中。我已经阅读了在谷歌上找到的所有内容,但仍然找不到问题所在。有什么想法吗?(我已经加入了redux承诺来处理请求承诺,但它从未做到这一点)

从“React”导入React;
从“redux form”导入{Field,reduxForm};
从“../utils/add_person_validation”导入验证;
从'react redux'导入{connect};
从“redux”导入{bindActionCreators};
从“../actions/index”导入{addPersonResponseAction};
从“../components/render_input_field”导入renderField;
//调用操作创建者-此部分成功
const doSubmit=函数(值){
addPersonResponseAction(值);
};
让AddPersonContainer=(道具)=>{
常数{
手推,
崭新的
重置,
提交
}=道具;
返回(
个人信息
提交
明确的价值观
);
};
const mapStateToProps=函数({addPersonResponse}){
返回{addPersonResponse};
};
const mapDispatchToProps=功能(调度){
返回bindActionCreators({addPersonResponseAction},dispatch);
};
const form=reduxForm({form:'addPerson',validate:validate});
AddPersonContainer=connect(mapStateToProps,mapDispatchToProps)(表单(AddPersonContainer));
导出默认AddPersonContainer;
/********************************************
*动作创造者
**********************************************/
从“axios”导入axios;
export const ADD_PERSON_RESPONSE='ADD_PERSON_RESPONSE';
导出常量addPersonResponseAction=(数据)=>{
恒姿态http://some-url/addperson';
const request=axios.post(postrl,{data});
返回{
类型:添加\u人员\u响应,
有效载荷:请求
};
};

Redux使用
mapDispatchToProps
包装操作-但您正在使用导入的方法调用未包装的版本

// call the action creator - this part succeeds 
const doSubmit = function(values) {
  addPersonResponseAction(values);    <------ Redux does not know anything about this
};
//调用操作创建者-此部分成功
const doSubmit=函数(值){
addPersonResponseAction(值){
常数{
手推,
崭新的
重置,
提交
}=道具;
const doSubmit=函数(值){

道具。addPersonResponseAction(值);谢谢!我就知道我忽略了一些东西!现在可以完美地工作了。为了补充这一点,请确保您已将减速机组合到根减速机中。谢谢。我正要在笔记本上打个洞。
// call the action creator - this part succeeds 
const doSubmit = function(values) {
  addPersonResponseAction(values);    <------ Redux does not know anything about this
};
let AddPersonContainer = (props) => {
  const {
    handleSubmit,
    pristine,
    reset,
    submitting
  } = props;

  const doSubmit = function(values) {
    props.addPersonResponseAction(values);  <----- Try this
  }

  return (
    <div className="row">
      <form onSubmit={handleSubmit(doSubmit)} >
          <div className="col-sm-6">
              <fieldset>
                <legend>Person Info</legend>
                <div className="form-group">
                  <Field name="personFirstName" component={renderField} type="text" label="First Name" className="form-control" />
                  <Field name="personLastName" component={renderField} type="text" label="Last Name" className="form-control" />
                  <Field name="birthday" component={renderField} type="date" label="Birthday" className="form-control" />
                  <Field name="group" component={renderField} type="text" label="Group" className="form-control" />
                </div>
              </fieldset>
          </div>
          <div className="form-buttons-container">
            <button className="btn btn-default form-button" type="submit" disabled={pristine || submitting}>Submit</button>
            <button className="btn btn-default form-button" type="button" disabled={pristine || submitting} onClick={reset}>Clear Values</button>
          </div>
      </form>
    </div> 
  );
};