I'm using Yup to validate my form. In one of my form, I want to validate that one <input type="file" /> has a file.
I've tested this (and it's not working):
Yup.object().shape({
file: Yup.object().shape({
name: Yup.string().required()
}).required('File required')
I've the following error message in the console:
file must be a
objecttype, but the final value was:null(cast from the value{}). If "null" is intended as an empty value be sure to mark the schema as.nullable()
Any idea?