📜  如何在反应表单挂钩上验证密码并确认密码 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:29.203000             🧑  作者: Mango

代码示例1
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'),
  });