score:0

for handle empty array error you don't need use required() and if you are using formik for handle with custom message use array().min(1, ' your message')

score:1

UPDATE / WARNING:

Previously only array().required() was required to make sure there was at leas 1 item in the array. For example [] would not pass the test.

⚠️ As of version 0.31.0 (2020-11-23) the behavior of array().required() changed! Now to make sure you have at least 1 item in the array you need to sure: array().required().min(1)

score:5

You can use .min():

validationSchema={Yup.object({
    permissions: Yup.array().min(1)
})}

Related Query

More Query from same tag