Add user form and fix bug

This commit is contained in:
2023-10-27 09:36:57 +07:00
parent 44e0d76e33
commit dfd6582f94
5 changed files with 261 additions and 11 deletions
+2 -1
View File
@@ -33,7 +33,6 @@ const useForm = (
// Get a local copy of stateSchema
useEffect(() => {
setDisable(true); // Disable button in initial render.
setInitialErrorState();
}, []); // eslint-disable-line
@@ -116,8 +115,10 @@ const useForm = (
// Making sure that there's no error in the state
// before calling the submit callback function
// and disabled button
if (!validateErrorState()) {
submitFormCallback(values);
setDisable(true);
}
},
[validateErrorState, submitFormCallback, values],