Improvements
- Massive perf boost over 2.0.6! We now save renders by comparing errors more efficiently in useFormik/Formik.
- FastField is now even faster. We fixed up our implementation of
shouldComponentUpdate
by refactoring the component away from usingstatic contextType
and back to using theconnect()
higher order component.
Bug fixes
-
Fixed regression where
dirty
is wasn't re-evaluated afterresetForm()
-
Fixed regression where handleChange would explode when event.target didn't exist (e.g. event.currentTarget
-
If there are validation errors while calling
submitForm()
, the promise will now rejects with errors (and of course abort the submit). Previously, it would abort the submit and resolve. The nuance is hard to describe so here is the difference.Before (2.0.6)
submitForm() // imagine there are some Yup validation errors .then(() => console.log("abort submit, did not call onSubmit, and end up here")) .catch(() => console.log("abort submit, did not call onSubmit, but only because of a runtime error"));
After (2.0.7)
submitForm() // imagine there are some Yup validation errors .then(() => console.log("executed onSubmit")) .catch((err) => console.log("aborted submit attempt"));
2.0.6: https://codesandbox.io/s/gracious-noether-bu8u6
2.0.7: https://codesandbox.io/s/objective-perlman-jxhuq
Commits
- Bump version to 2.0.7 17d82bc
- Fix dirty flag when calling resetForm with current values (#1986) ec1d679
- Fix no target error (#2024) c5ec709
- Fix unnecessary rendering of FastField (#2070) 2b6f71e
- Ensure dirty is reevaluated when form is reset (#2087) 39bfbfb
- fix FormikHelpers types (#2079) 5c59dbe
- Avoid unnecessary re-renders by comparing errors to previous errors (#2069) f4ff028
- handle an empty array value argument to setIn (#2072) 9da3288
- Throw validation errors from submitForm (#1843) 37870bf
- (docs) : update tutorial Final Result code sandbox link (#2055) 4ac6186