iTranslated by AI
The content below is an AI-generated translation. This is an experimental feature, and may contain errors. View original article
👏
Dynamic Validation with Yup Based on Other Values
Use when!
Yup.string()
.when("firstName", {
is: 'satoshi',
then: Yup.string().required("Must enter email address").max(2)
}),
Discussion