Something like:
validationSchema: props => {
const schema = {};
props.answers.forEach(answer => {
schema[answer.id] = Yup.string().required('Required');
});
return Yup.object().shape(schema);
},
Weirdly @jaredpalmer and I were just talking about this literally five minutes before you posted, and we are probably going to add this feature today.
Most helpful comment
Weirdly @jaredpalmer and I were just talking about this literally five minutes before you posted, and we are probably going to add this feature today.