I have React form and used yup validation. I have 5 input text fields from which at least one should be filled and accordingly show the error "Please fill at least one field". below is the code used.
Yup validation
initialValues={{
domain0: "",
}}
validationSchema={(Yup) =>
Yup.object().shape(Object.assign({
domain0: Yup.string().required('Domain should not be blank'),
}))}```
Form HTML
```<div>
<Label className="" text="Domains" />
<div className="oui-row oui-px-2">
{[...Array(5)].map((e, i) => {
return (
<div className="col-4">
<Input
type="text"
name={`domain${i}`}
value={values[`domain${i}`]}
validationProps={props}
/>
</div>
)
})}
</div>
</div>```
please suggest the best approach for the same and yup validation for the above condition
thanks in advance.