Build forms in React, without the tears 😭
APACHE-2.0 License
Bot releases are visible (Hide)
Published by github-actions[bot] about 4 years ago
4148181
]:
Published by github-actions[bot] about 4 years ago
4148181
#2794 Thanks @jaredpalmer! - setValue
can now optionally accept a function as a callback, exposing React.SetStateAction
functionality. Previously, only the entire object was
allowed which caused issues with stale props.
setValues(prevValues => ({...prevValues, ... }))
Published by github-actions[bot] about 4 years ago
bda9f41
#2785 Thanks @jaredpalmer! - Replace all instances of the deprecated React.SFC type with React.FCPublished by github-actions[bot] about 4 years ago
bda9f41
]:
Huge thanks to @brunohkbx, @aloeugene, @mstanielewicz, @krailler, @zslabs, @whazap, @jcolbyfisher, @jkimbo, and @lukebrobbs for helping!
Huge thanks to @mackness, @JanCizmar, @is2ei, @leonvisscher, @stephan281094, and @brentvatne for helping!
validate
: #2195Huge thanks to @brunohkbx, @Menardi, @gwn, @fabb, and @jamesmosier for helping!
Huge thanks to @BjoernRave, @emrosenf, @kristenmills, @dremex, @zachintosh, and @deini for helping!
value
was not specified on a checkbox as well as when there is just one checkbox.FieldArray
to use latest values for validation: #2166Huge thanks to @wallymathieu, @eliamaino-fp, and @mrmuhammadali for helping!
https://github.com/jaredpalmer/formik/compare/v2.1.1-canary.0...v2.1.1-canary.1
Huge thanks to @wallymathieu, @eliamaino-fp, and @mrmuhammadali for helping!
Add FieldHelpers
object to the array returned by useField
: #2124. This
exposes three helper functions to allow you to imperatively change the
field in question:
setValue(value: any)
setTouched(value: boolean)
setError(value: string)
Before
const MyInput = (props) => {
const formik = useFormikContext()
const [field, meta] = useField(props)
const handleThing = () => {
formik.setFieldValue(props.name, 'boop')
}
// ...
}
After
const MyInput = (props) => {
const [field, meta, helpers] = useField(props)
const handleThing = () => {
helpers.setValue('boop')
}
// ...
}
Huge thanks to @drivasperez for helping!
Huge thanks to @viniciusdacal for helping!
https://github.com/jaredpalmer/formik/compare/v2.0.10...v2.0.11
https://github.com/jaredpalmer/formik/compare/v2.0.8...v2.0.9
https://github.com/jaredpalmer/formik/compare/v2.0.7...v2.0.8