[英]redux-form how to show async validation success
我有一個帶有redux-form
和異步驗證功能的更改密碼表單。
如何判斷異步驗證何時成功完成?
我正在嘗試從 props 獲取字段數據,但我得到了undefined
。
怎么做到呢?
function ChangePassword(props) {
console.log(props);
return (
<div className="general-information-container ">
<form className="relative general-information-form change-password-container">
<div className="field-header">Genreal information</div>
<Field
name="currentPassword"
component={renderField}
type="password"
placeholder="Enter you current password"
label="Current Password"
/>
<Field
name="newPassword"
component={renderField}
type="password"
label="New Password"
placeholder="Enter New Password"
/>
<Field
name="confirmNewPassword"
component={renderField}
type="password"
label="Confirm Password"
placeholder="Confirm Password"
/>
<button type="submit" className="edit-values">
Change Password
</button>
</form>
</div>
);
}
export default reduxForm({
form: "changePassword",
asyncValidate: passwordAsyncValidate,
asyncBlurFields: ["currentPassword"],
})(ChangePassword);
謝謝🙏
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.