Skip to content

Releases: jaredpalmer/formik

v0.9.3

Choose a tag to compare

@jaredpalmer jaredpalmer released this 02 Oct 18:37

Changes

  • #168 Formik will no longer automagically reset the form when initialValues change. I added this feature thinking it would be desirable on most apps. However, it appears that I was wrong and it created headaches for people using Redux to get their initial values. Sorry about that. That's on me. If you still want this behavior, pass <Formik enableReinitialize={true}/> or withFormik({ enableReinitialize: true })(...). \

If you want to have more control, initialValues (i.e. initialValues as of first mount) is now available in props, so you can use that to control reset behavior with more granularity if you want to.

Bug Fix / Optimization

  • #176 Run validations on methods in a callback. This allows React to batch updates and avoid a double render! Thanks @jontansey

New contributors 🎉

What's coming?

  • There is some progress on synchronous Yup. This would be game changing for testing.
  • I benchmarked Redux Form vs. Formik and its not even a competition. I am working on a blog post this weekend. In the process, though, I also found a way to very safely optimize vanilla <Field/> (i.e. one's without custom component's) using shouldComponentUpdate. I have not yet released this because of I want to wait on #182 and #167 . Those on the bleeding edge can copy and paste the code from #185 .
  • Website is in the works.

v0.9.2

Choose a tag to compare

@jaredpalmer jaredpalmer released this 27 Sep 00:00

Patch Release

  • #180 Correctly pass props to validate and validationSchema in withFormik()
  • #169 Fix check to call resetForm on componentWillReceiveProps

v0.9.1

Choose a tag to compare

@jaredpalmer jaredpalmer released this 20 Sep 22:14

After some discussion validateOnBlur is now set to true by default.

v0.9.0

Choose a tag to compare

@jaredpalmer jaredpalmer released this 19 Sep 14:27

🎉 What's new?

  • New <Formik /> component
  • <Field /> and <Form /> helpers
  • mapValuesToPayload has been removed
  • Improved warnings and error messages
  • More docs and examples
  • Website in the works...

🚧 Potentially breaking changes

  • validateOnChange now defaults to true
  • validateOnBlur now defaults to false

🚨 🚨 Breaking change 🚨 🚨

  • Formik() has been renamed withFormik(). (The named Formik import is now used for the component and not for the HoC)

Migrating from 0.8.x to 0.9.x

The Formik() HoC function in 0.8.x has been renamed withFormik() in 0.9.0. Since withFormik() is fully backwards compatible (in both plain JavaScript and TypeScript), you can safely do a search and replace and things will just work.

Before (0.8.x)

import { Formik } from 'formik'

const enhancer = Formik({ ... config ... })

...

After (0.9.x)

import { withFormik } from 'formik'

const enhancer = withFormik({ ... config ... })

...

v0.9.0-beta.2

Choose a tag to compare

@jaredpalmer jaredpalmer released this 03 Sep 15:01
  • Fix type signature of FormikBag in withFormik()

v0.9.0-beta.1

Choose a tag to compare

@jaredpalmer jaredpalmer released this 01 Sep 20:42
  • Fix TS type in handleSubmit of withFormik

Begin internal migration to 0.9.0 @palmerhq ...

v0.9.0-alpha.10

Choose a tag to compare

@jaredpalmer jaredpalmer released this 31 Aug 21:54
  • Fix incorrect prop-type on <Field />

v0.8.9

Choose a tag to compare

@jaredpalmer jaredpalmer released this 01 Aug 14:55

Patch

  • #109 Fix bug is hoist statics (caused crash in RN)
  • Moved to TravisCI instead of CircleCI

v0.8.8

Choose a tag to compare

@jaredpalmer jaredpalmer released this 31 Jul 19:55

Patch

  • #103 Fixes isValid logic when form is dirty

v0.8.7

Choose a tag to compare

@jaredpalmer jaredpalmer released this 31 Jul 15:43

tl;dr

validationSchema can now alternatively accept a function that returns a Yup schema (instead of just a schema)

Old:
validationSchema?: Schema

New:
validationSchema?: Schema | ((props: Props) => Schema)