Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug when initializing the form when validation is synchronous #2

Conversation

fbarbare
Copy link

@fbarbare fbarbare commented Jul 23, 2024

There was a bug in the useEffects that was not detected because of the async nature of the form validation. The useEffect running based on enableReinitialize was running on mount, overriding the values that validateOnMount was setting. Unifying them into 1 useEffect makes sure we run the right function at the right time.

@fbarbare fbarbare marked this pull request as ready for review July 23, 2024 08:50
@fbarbare fbarbare merged commit 53c660b into fb/make-formik-synchronous-when-validation-functions-are-sync Jul 23, 2024
@fbarbare fbarbare deleted the fb/bug-when-initializing-form-when-synchronous branch July 23, 2024 11:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants