Build forms in React, without the tears 😭
APACHE-2.0 License
Bot releases are visible (Hide)
Published by github-actions[bot] about 1 year ago
Published by github-actions[bot] about 1 year ago
41720c2
#3862 Thanks @yazaldefilimonepinto! - Forward className
for custom components used with Field
da58b29
#3858 Thanks @alaanescobedo! - Remove use of deprecated StatelessComponent
type in favor of FunctionComponent
5c01ee7
#3872 Thanks @rajpatelbot! - FIX: Fixed resetForm function dependency issue
Published by github-actions[bot] about 1 year ago
Published by github-actions[bot] about 1 year ago
Published by github-actions[bot] about 1 year ago
9e0a661
]:
Published by github-actions[bot] over 1 year ago
96280d3
#3817 Thanks @probablyup! - Updated internal types to support React 18.Published by github-actions[bot] over 1 year ago
96280d3
]:
Published by github-actions[bot] over 1 year ago
Published by github-actions[bot] over 1 year ago
2b194c2
#3808 Thanks @NagaiKoki! - fix type of setFieldValue function
708bcb2
#3813 Thanks @probablyup! - Revert FieldArray
"shouldComponentUpdate" performance optimization. As it turns out, it's a common use case to have JSX controlled via non-Formik state/props inside of FieldArray
, so it's not safe to cancel re-renders here.
187e47d
#3815 Thanks @probablyup! - Revert Yup transform support for the time being, this may be re-introduced in a future release under an opt-in prop.
Published by github-actions[bot] over 1 year ago
2f53b70
#3796 Thanks @probablyup! - Add support for Yup "transforms".Published by github-actions[bot] over 1 year ago
2f53b70
]:
Published by github-actions[bot] over 1 year ago
f075a0c
]:
Published by github-actions[bot] over 1 year ago
f075a0c
#3798 Thanks @probablyup! - Fixed the use of generics for the ArrayHelpers
type such that any[]
is the default array type and for each individual method the array item type can be overridden if necessary.Published by github-actions[bot] over 1 year ago
Published by github-actions[bot] over 1 year ago
Published by github-actions[bot] over 1 year ago
73de78d
#3788 Thanks @probablyup! - Added typescript generics to ArrayHelpers
interface and its methods so that users who use TypeScript can set the type for their arrays and have type safety on array utils. I have also gone ahead and made supplying a type for the generic optional for the sake of backwards compatibility so any existing TS code that does not give a type for the FieldArray will continue to work as they always have.
39a7bf7
#3786 Thanks @probablyup! - Yup by default only allows for cross-field validation within the
same field object. This is not that useful in most scenarios because
a sufficiently-complex form will have several yup.object()
in the
schema.
const deepNestedSchema = Yup.object({
object: Yup.object({
nestedField: Yup.number().required(),
}),
object2: Yup.object({
// this doesn't work because `object.nestedField` is outside of `object2`
nestedFieldWithRef: Yup.number()
.min(0)
.max(Yup.ref('object.nestedField')),
}),
});
However, Yup offers something called context
which can operate across
the entire schema when using a \$ prefix:
const deepNestedSchema = Yup.object({
object: Yup.object({
nestedField: Yup.number().required(),
}),
object2: Yup.object({
// this works because of the "context" feature, enabled by $ prefix
nestedFieldWithRef: Yup.number()
.min(0)
.max(Yup.ref('$object.nestedField')),
}),
});
With this change, you may now validate against any field in the entire schema,
regardless of position when using the \$ prefix.
Published by github-actions[bot] over 1 year ago
validate
: #2195Huge thanks to @BjoernRave, @emrosenf, @kristenmills, @dremex, @zachintosh, @deini, @brunohkbx, @Menardi, @gwn, @fabb, and @jamesmosier for helping!
https://github.com/jaredpalmer/formik/compare/v2.1.1...v2.1.2
initialValues
and a value
wasn't specified at /. Now we are nicer about it, and set the next value
to true
instead of throwing.Huge thanks to @mackness, @JanCizmar, @is2ei, @leonvisscher, @stephan281094, and @brentvatne for helping!
https://github.com/jaredpalmer/formik/compare/v2.1.2...v2.1.3