我正在使用redux-form,connect和router(withRouter)构建登录表单,但是我真的很困惑如何使用这三个方法导出组件:
SignUp = connect(
mapStateToProps,
mapDispatchToProps
)(SignUp);
export default withRouter(
reduxForm({
form: "registerForm", // a unique identifier for this form
validate
})(SignUp)
);
并且以上代码不起作用,因为道具未定义
TypeError:无法读取未定义的属性“ props” handleFormSubmit src / containers / Auth / SignUp.js:43
40 |
41 | handleFormSubmit(formValues) {
42 | console.log(formValues);
43 | this.props.onAuth(formValues);
| ^ 44 | }
45 | render() {
46 | const { handleSubmit, pristine, reset, submitting } =
this.props;
谢谢