I'm building a form in React using Formik and React-bootstrap and I'm using Yup to validate the form.
I have 2 fields, let's say FieldA and FieldB. FieldA is not required but FieldB is required if FieldA is not empty.
FieldA is a textbox while FieldB is multiple select. My validation rule for FieldB must be:
FieldA !=='' ? FieldB is required : do nothing