const {values, handleChange, handleSubmit, errors} = useFormik({
initialValues: {
name: '',
address: '',
latitude: '',
longitude: '',
nit: '',
category: '',
email: '',
},
validationSchema: {formSchema},
validateOnChange: false,
onSubmit: () => console.log(values),
})
En: The error occurs because we are surrounding the validation schema with keys, we must pass it without keys, keep in mind the validateOnchange.
Es: El error ocurre porque estamos rodeando el esquema de validación con llaves, debemos pasarlo sin llaves, tener presente el validateOnchange
If you are using yup, the formSchema must be a yup.object();
validationSchema: yup.object(formSchema)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With