Async validation triggers field render twice
Are you submitting a bug report or a feature request?
Not sure if this is a bug or a current feature 🤔
What is the current behavior?
When using async form validation (before submit), it triggers field render twice. First one with error set to none and then with actual error. This happens on every keypress.
What is the expected behavior?
I'd like to make it work as a sync one when there is only one render on keypress and no error state pop before/after validation.
Sandbox Link
https://codesandbox.io/s/n9kn940k84
In this example, there are both validateAsync and validateSync for test, open console to see the difference.
What's your environment?
React Final Form version 3.6.5 Final Form version 4.9.1
@erikras maybe you have an idea what to do with this 🙏
I see same behaviour
I have same problem. On first render, my Wizard Form trigger form validation every time. My form validation is async function and every field trigger validation on render the form. If i have 20 fields, this breaks my page.
Why i can't stop validation on first render? And this flag validateOnBlur has no effect. Whatever i put true or false it's same, on load my page my Wizard trigger nth times the Form validation and Validation trigger render function again.
This bug still encounter :(
React Final Form version 6.0.0 Final Form version 4.13.0
Still an issue today, mixing synchronous and asynchronous as with react-redux is a pain with final-form :'(
I have a visual glitch where the synchronous error disappears while the promise is being resolved
the current behavior is correct. one for value change,one for error message change!