-
-
Save mfrancois3k/9e3629e505f1809e15075926d4ec3857 to your computer and use it in GitHub Desktop.
[Formik] Validation Schema
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const validationSchema = Yup.object().shape<IFormValues>({ | |
name: Yup.string().required("Please enter your name"), | |
email: Yup.string() | |
.email("Please enter valid email") | |
.required("Please enter your email"), | |
username: Yup.string() | |
.required("Please enter username") | |
.min(5, "Your username is too short") | |
.max(30, "Your username is too long"), | |
password: Yup.string() | |
.min(5, "Your password is too short") | |
.max(30, "Your password is too long"), | |
password_confirmation: Yup.string() | |
.oneOf([Yup.ref("password"), null], "Password does not match") | |
.required("Please retype password") | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment