I'm trying to require one of two checkboxes to be selected in a form. The following doesn't seem to work according to the documentation:
yearGroups: yup.object().shape({
primary: yup.bool().when('yearGroups.primary', {
is: false,
then: yup
.bool()
.oneOf([true], '')
.required()
}),
secondary: yup.bool().when('yearGroups.secondary', {
is: false,
then: yup
.bool()
.oneOf([true], '')
.required()
}),
}),