Skip to content

How to create yup validator with array of string type for checkboxes #101

Answered by airjp73
arpitdalal asked this question in Q&A
Discussion options

You must be logged in to vote

I responded on the issue, but responding here as well for completeness. Unfortunately, this behavior is a known and documented limitation. To support this use case, you need to write a validator that can handle it being either a single string or an array of strings. I believe there's a way to preprocess values in yup that you could use to do this, but I don't know how that works off the top of my head.

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by arpitdalal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants