作者:萱恭俊逸明靖 | 来源:互联网 | 2022-12-06 19:58
我使用react-stepzilla开发了多步骤注册表单.我在此注册中使用react和redux.
我需要验证步骤,然后按照这些步骤将验证添加到步骤中
我在步骤中添加了isValidated函数.
它正在反应但它不能在还原反应中使用反应可能是反应 - 步骤是HOC的问题.
我按照react-stepzilla模块git解决方案,但我收到错误"main.js:318未捕获的TypeError:无法读取属性'isValidated'的undefined"
//React stepzilla main component
const steps = [
{ name: 'step1', component: },
{ name: 'step2', component: },
{ name: 'step3', component: }
]
class MultiStep extends Component {
render() {
return (
Register for New Account
);
}
}
//Step1 Component:
// Checking the validation for registration
isValidated(){
alert("checking isValidated calling")
return this.state.count > 2
}
// connecting with redux
export default connect((state) => ({register_reducer: state.register_reducer.register_user}),{saveUser})(Step1); //This is not working and getting the error
//connecting without redux
export default Step1 // this is working and checking the validation part
当我们与redux连接时,我收到错误"无法读取属性'isValidated'的未定义".
请帮我解决这个问题.