I have a field which is a array of strings, and depending on this array's length I show inputs. If for example the length of arrray id 5 I show 5 inputs. However by default I have to show 3 inputs, and thats why my default values: [null, null, null]. Now what is the right way to do the validation so it checks the all values, and validate only if at least one is not null?
I know some answers, where they say: yup.array().min(1) is the solution, but in my case the initial value of the field is not an empty array. As I mentioned above there are null values, and I have to check every value of the array
I don't know yup but in plain javascript you could use some
const invalidData = ['a', null, 'c']
const validData = [1, 2, 3]
const check = data => !data.some(v => v=== null)
console.log(invalidData, check(invalidData))
console.log(validData, check(validData))