-
-
Notifications
You must be signed in to change notification settings - Fork 41
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
Async validation re-renders all fields #74
Comments
May be the same problem! you need to add |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Not sure if this is a Final Form Arrays or a Final Form or Yup issue, but posting it here for initial guidance.
Seems that when I have a form with a FieldArray and async validation (Yup), all empty fields in the array re-renders on each keypress in any other field (even outside the array), even if all subscriptions are disabled.
When comparing the
meta
information for the rendered component, it seems thatmeta.errors
,meta.invalid
andmeta.valid
changes briefly when typing. Given the field is invalid, the field will briefly turn valid and then invalid again, making it re-render even though nothing actually changed.Changing the validation to sync resolves the issue.
The following sandbox showcases the issue, and includes a sync validator for comparison.
https://codesandbox.io/s/react-final-form-field-arrays-w-async-validation-nlr1i?file=/index.js
What's your environment?
🏁 Final Form Arrays version 3.0.2
🏁 Final Form version 4.20.2
The text was updated successfully, but these errors were encountered: