Skip to content
Open
5 changes: 5 additions & 0 deletions .changeset/make-formik-possibly-synchronous.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'formik': minor
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@quantizor we might want to make this a major version bumb in the end.

I had not thought of that initially but if anyone implemented things as setFieldValue(..).catch(...) then it would break if their validation functions would be sync. It would be completely fine if they would implement it as await setFieldValue(..) or void setFieldValue(..) though.

What are your thoughts?

---

Formik might not need to run asynchronously, it all depends on the validation functions. This change makes it all run synchronously if the validation functions do not return any promise, making all the updates much faster and creating les re-renders.
Loading