How to make validation using formik in react component

34 Views Asked by At

I have tried to use formik in register component, but in validation I have problem. I already made validation for each field such as name, email, password, but I can't see that. How can I fix that? Please answer me about that.

{errors.fullname && touched.fullname && {errors.fullname}}

1

There are 1 best solutions below

0
Edward Thomas On BEST ANSWER

You can try to put onBlur event on each field.

<Form.Control type="text" id='fullname' onBlur={handleBlur} value={values.fullname} placeholder="" onChange={handleChange} />
{errors.fullname && touched.fullname && <div className="d-block invalid-tooltip">{errors.fullname}</div>}