I am using a form with react-bootstrap, formik and yup.
Do you have a solution to correct this problem?
CodePudding user response:
you need to use handleBlur
and touched
to solve this issue
https://stackblitz.com/edit/formik-reactbootstrap-validation-tdkizk?file=src/App.js
<Form.Control
value={formikProps.values.comment || ''}
onChange={formikProps.handleChange}
onBlur={formikProps.handleBlur}
as="textarea"
rows={3}
name="comment"
isInvalid={
!!formikProps.touched.comment &&
!!formikProps.errors.comment
}
/>