Skip to content

Why can required fields be undefined as type? #3702

Answered by logaretm
Nikola-Milovic asked this question in Q&A
Discussion options

You must be logged in to vote

That is a question you should submit to yup not vee-validate. But you can fix that by adding .defined or .default to remove the undefined type possibility.

const schema = object({
  title: string().required().defined(),
  description: string().required().defined()
});

I believe the types will change with yup's 1.0 release.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@Nikola-Milovic
Comment options

@Delari
Comment options

Answer selected by Nikola-Milovic
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants