1) accessing "isValid" inside "validateForm" function returns wrong data
2) formic form renders multiple times when validateForm function is triggered manually.
During this multiple render, if validation has failed.... in first render error object is empty and
in second render error object is not empty (thus for one validateForm function execution, there is multiple error render with different values).
Problem code link: https://snack.expo.io/@rosnk/formik-submit-test
Expected behavior
1) want proper "isValid" value inside validateForm().then() function when promise has been resolved
2) It might be formik is internally setting the state thus there are multiple rerenders of the form, thus making isValid and error having different values in different renders. Is this different values in multiple render expected behavior in formik??
have my own implementation of mult-step forms and i want to validate on button click, if form is valid then proceed to next form step..... wrong value of "isValid" inside "validateForm" .then function is creating problem to implement my logic.
Bug report
Current Behavior
1) accessing "isValid" inside "validateForm" function returns wrong data 2) formic form renders multiple times when validateForm function is triggered manually. During this multiple render, if validation has failed.... in first render error object is empty and in second render error object is not empty (thus for one validateForm function execution, there is multiple error render with different values).
Expected behavior
1) want proper "isValid" value inside validateForm().then() function when promise has been resolved 2) It might be formik is internally setting the state thus there are multiple rerenders of the form, thus making isValid and error having different values in different renders. Is this different values in multiple render expected behavior in formik??
Reproducible example
https://snack.expo.io/@rosnk/formik-submit-test (can be scanned with expo app in phone and log can be checked)
Suggested solution(s)
n/a
Additional context
have my own implementation of mult-step forms and i want to validate on button click, if form is valid then proceed to next form step..... wrong value of "isValid" inside "validateForm" .then function is creating problem to implement my logic.
Your environment