Build forms in React, without the tears π
APACHE-2.0 License
Bot releases are hidden (Show)
initialStatus
and mapPropsToStatus
so that status can be initialized. This could be useful if you are trying to have some arbitrary state that should be reset with your form.insert
and alterTouched falsy behavior (#1311) 1524339connect
. For some reason, the last build included an extra generic to the returned React.ComponentType
causing certain versions of the react types to get mad./formik
directory (a poor man's GitHub pages basically).tiny-warning
(thanks @TrySound !)Before: Without explicit types, render prop & onSubmit
's parameters yielded any
type.
After: Types are now inferred by initialValues
!!! No generics are needed if you are using TS 3.2.2
isValidating
and smarter internal orchestration of validationIn 1.4.x isValidating
will only now toggle during submission and if you manually call validateForm
, otherwise it will remain false
. In the past, it toggled on change and blur which caused a performance regression with certain libraries (like styled-components). Additionally, Formik internally runs validation slightly more intelligently: it will now cancel a running validation promise if a newer one is executed prior to committing the update. This can save lots and lots of renders.
Formik v2 is coming very soon (#1063)!!! We'll start to publish canary releases next week. Stay tuned!
<button type="reset>
will now call handleReset
setIn
now keeps the same object if nothing has changed<Field>
and <FastField>
now "register" with the parent <Formik>
during componentDidMount()
instead of in componentWillMount
/constructor
. This change also ensures that Formik is React Fiber ready.<FastField>
will now rerender when isSubmitting
changes<FieldArray>
when changing indexes where touched
was incorrectrender
prop definition (#944) 3024758ErrorMessage
import (#933) ddb6d9c<ErrorMessage />
component! (#896)<ErrorMessage />
(#896) f05e9d3<FastField>
was broken by React 16.4 (#659). The registration technique we were using led to a bunch of weird edge cases, especially around submission and blur. In this release, <FastField>
now works as expected (and now also has full documentation).<Formik<Values> ....>
instead of <Formik<{}, Values> ....>
. The first generic was used for so that we could properly get type safety on withFormik()
. Ordering didn't matter prior to the introduction of JSX Generics, but now, with this swap, the more common usage is easier to type.push()
Published by jaredpalmer about 6 years ago
tslib
as a dependency for a smaller bundle, and want to smoke test it on some applications. Let us know if you run into problemsCommits:
connect()
higher-order componentisValidating: boolean
to Formik state!!! #753
isValidating
is now set to true whenever validation is run. This includes validation before submission. This means that you can display UI in response to more state combinations. Mostly, if isSubmitting
is true
and isValidating
is false, you can now know you are going executing you submission handler. When both isSubmitting
and isValidating
are false
, you know you are back to idle state. Remember, that isSubmitting
still means "is submit being attempted?" so you can / should still use it to prevent double submits by using it to disable buttons etc.submitCount
for submitAttemptCount
submitSuccessCount
and submitFailCount
Thank you to everyone who reported the issue.