Skip to content

Instantly share code, notes, and snippets.

@scottgamer
Created March 16, 2021 03:18
Show Gist options
  • Select an option

  • Save scottgamer/bef8de10e8f98a3c4c3fc9ff7bec3c10 to your computer and use it in GitHub Desktop.

Select an option

Save scottgamer/bef8de10e8f98a3c4c3fc9ff7bec3c10 to your computer and use it in GitHub Desktop.
initial validation schema
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