npm formik 0.11.0

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

✨ Formik 11.0 ✨

The New stuff 💎 ✨

  • Support for both path and dot syntax for handling deep updates and arrays <Field name="social.facebook" /> and <Field name="friends[1]" />
  • Sync and Async field-level validation via <Field validate={value => ...} />
  • A new onReset prop for <Formik />.
  • New <FieldArray> component
  • TypeScript 2.6.2 support, 2.7.x in the next few days
  • React 16
import React from 'react';
import { Formik, Form, Field, FieldArray } from 'formik'

export const FriendList = () => (
  <div>
    <h1>Friend List</h1>
    <Formik
      initialValues={{ friends: ['jared', 'ian', 'brent'] }}
      onSubmit={...}
      render={formikProps => (
        <FieldArray
          name="friends"
          render={({ move, swap, push, insert, unshift, pop }) => (
            <Form>
              {/*... use these however you want */}
            </Form>
          )}
        />
    />
  </div>
);

Potentially Breaking Change ⚠️ 🚒 🚫 PLEASE READ.

dirty (and thus isValid) has changed due to popular demand/consensus.

Old meaning: "has any field been touched?"
New meaning: "has any field value changed?"

Deprecations

handleChangeValue has been removed entirely. It's been deprecated since 0.8

Don't miss a new formik release

NewReleases is sending notifications on new releases.