v0.11.0
β¨ 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