JavaScript community news log


Daily JavaScript community news and chat

A RubyFlow-inspired community news site for JavaScript and related technologies.

Anyone can post news to be seen by the community (and maybe selected for JavaScript Weekly!)

How to Create an Optional Dynamic Validation Schema based on a Value with the Yup Val

In this lesson we’ll show how to setup a nested validation structure using the yup library. We’ll then use the yup.lazy method to evaluate the value at runtime and adjust our validation schema. We’ll make our nested validation optional only if our optionalObject actually exists.

Post a comment

You can use basic HTML markup (e.g. <a>) or Markdown.

As you are not logged in, you will be
directed via GitHub to signup or sign in