Skip to content

Commit

Permalink
Fix validateOnMount (#1971)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredpalmer authored Oct 30, 2019
1 parent 56c0a80 commit d90149e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Formik.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -348,11 +348,11 @@ export function useFormik<Values extends FormikValues = FormikValues>({
}
);

// React.useEffect(() => {
// if (validateOnMount && isMounted.current === true) {
// validateFormWithLowPriority(props.initialValues);
// }
// }, [props.initialValues, validateFormWithLowPriority]);
React.useEffect(() => {
if (validateOnMount && isMounted.current === true) {
validateFormWithLowPriority(props.initialValues);
}
}, [props.initialValues, validateOnMount, validateFormWithLowPriority]);

const resetForm = React.useCallback(
(nextState?: Partial<FormikState<Values>>) => {
Expand Down

0 comments on commit d90149e

Please sign in to comment.