yarn formik 2.0.7

latest releases: 2.4.6, 2.4.5, 2.4.4...
4 years ago

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 using static contextType and back to using the connect() higher order component.

Bug fixes

  • Fixed regression where dirty is wasn't re-evaluated after resetForm()

  • 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

v2.0.6...v2.0.7

Don't miss a new formik release

NewReleases is sending notifications on new releases.