I have the following code:
passwordConfirmation: yup.string().oneOf([yup.ref("password")], "Passwords do not match")
However, this does not work if the passwordConfirmation field is empty (using Formik). I don't understand why yup treats an empty value as correct. It's very unintuitive. I could add required(...) though, but I would like to only have one error message -- namely "Passwords do not match".