This example shows how to create a password-confirmation-like rules using either yup or global validators.
yup