Skip to content

Instantly share code, notes, and snippets.

@mrkacan
Created May 2, 2021 06:56
Show Gist options
  • Save mrkacan/d5eb62195ac32a6367acbc6b62a0ba1b to your computer and use it in GitHub Desktop.
Save mrkacan/d5eb62195ac32a6367acbc6b62a0ba1b to your computer and use it in GitHub Desktop.
Yup User Info Schema
import * as Yup from "yup";
const userInfoSchema = Yup.object().shape({
firstName: Yup.string()
.min(4, "First name should be minimum 4 character")
.required("First name is required"),
lastName: Yup.string()
.min(5, "Last name should be minimum 5 character")
.required("Last name is required"),
email: Yup.string()
.email("Please type correct email address")
.required("Email is required")
});
export { userInfoSchema };
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment