Created
March 16, 2021 03:18
-
-
Save scottgamer/bef8de10e8f98a3c4c3fc9ff7bec3c10 to your computer and use it in GitHub Desktop.
initial 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
| import * as yup from "yup"; | |
| const isRequiredMessage = "This field is required"; | |
| export default yup.object().shape({ | |
| firstName: yup.string().required(isRequiredMessage).max(10), | |
| lastName: yup.string().optional().max(10), | |
| email: yup.string().required(isRequiredMessage).email(), | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment