Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Uncaught TypeError: (intermediate value)(...) is not a function [Yup, formik]

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

like image 922
Alexander Rincón S. Avatar asked Aug 25 '26 22:08

Alexander Rincón S.


1 Answers

If you are using yup, the formSchema must be a yup.object();

validationSchema: yup.object(formSchema)

like image 114
Colton Deegan Avatar answered Aug 28 '26 08:08

Colton Deegan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!