Jak zweryfikować hasło i potwierdzić hasło na haku formularza React

const validationSchema = yup.object().shape({
    newPassword: yup.string()
      .required('New Password is required'),
    confirmPassword: yup.string()
      .required('Confirm Password is required')
      .oneOf([yup.ref('password'), null], 'Passwords does not match'),
  });
Brave Beetle