When i try to use the following code from Readme, i get the following error:
1.
useEffect(() => {
ValidatorForm.addValidationRule("isPasswordMatch", (value) => {
if (value !== state.password) {
return false;
}
return true;
});
return ValidatorForm.removeValidationRule("isPasswordMatch");
});

Solution: use code from the DEMO.
My case - React hooks:
useEffect(() => {
if (!ValidatorForm.hasValidationRule("isPasswordMatch")) {
ValidatorForm.addValidationRule("isPasswordMatch", (value) => {
if (value !== state.password) {
return false;
}
return true;
});
}
return function cleanPasswordMatchRule() {
if (ValidatorForm.hasValidationRule("isPasswordMatch")) {
ValidatorForm.removeValidationRule("isPasswordMatch");
}
};
});
When i try to use the following code from Readme, i get the following error:
1.
Solution: use code from the DEMO.
My case - React hooks: