Accepted answer

It looks like the field is expecting the string to be required based on your validationSchema.

The error helped point me in the right direction. Here's the docs for Yup .nullable():

Try adding .nullable() to the chain of validations.

validationSchema={object().shape({ category: string().required("Category is required.").nullable() })}

Hope this helps. enter image description here


Don't assign default value (initialValue in formik) as null.

Related Query

More Query from same tag