I have the following object:
{
array: [1]
}
And the following code:
myArray: Yup.array().of(
Yup.object().shape({
name: Yup.string().max(255).required().label('Name')
})
)
Now I check the name is required, I need to check if myArray
has length === 1
to return an error.