const schema = yup.object().shape({
1: yup.string().required("Required"),
2: yup.string().required("Required"),
3: yup.string().required("Required"),
...,
99: yup.string().required("Required"),
100: yup.string().required("Required"),
})
const validation = () => {
const arr = []
const obj = {}
arr.push(yup.string().optional())
for (let i = 1; i < 100; i++) {
arr.push(obj[i] = yup.string().required('Нужен ответ на вопрос'))
}
return arr
}
const schema = yup.object().shape({
...validation()
})