You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the validationSchema prop, the errors property from Formik is initialized to an object, where each key is the name of the key from the validationSchema and the value is Required for any field in the validationSchema set to .required(). If an entry in validationSchema is NOT required, that entry is excluded from the errors object in Formik.
For example:
constvalidationSchema={name: Yup.string().required(),state: Yup.string()}// errors object would be set to:{name: 'Required'}// initialErrors is never set so it's set to:{}
When calling the resetForm method from Formik, among other things this method resets the errors object to the value from initialErrors. Since initialErrors is never set, errors gets set to {}.
Any functionality that depends on the presence of errors after the form has been reset will experience unexpected behavior
The text was updated successfully, but these errors were encountered:
Fixes the submit button be disabled when it shouldn't. Fixes the reset
button to reset to the proper initial errors state. Fixes the helper
text to always be in a correct state.
✅ Closes: #59, #83, #47
Issue:
When using the
validationSchema
prop, theerrors
property fromFormik
is initialized to an object, where each key is thename
of the key from thevalidationSchema
and the value isRequired
for any field in thevalidationSchema
set to.required()
. If an entry invalidationSchema
is NOT required, that entry is excluded from theerrors
object in Formik.For example:
When calling the
resetForm
method from Formik, among other things this method resets theerrors
object to the value frominitialErrors
. SinceinitialErrors
is never set,errors
gets set to{}
.Any functionality that depends on the presence of
errors
after the form has been reset will experience unexpected behaviorThe text was updated successfully, but these errors were encountered: