1×
Become a member
to unlock all features

Create egghead account to access 1,000+ tutorials and resources from expert developers.

Create account
Autoplay

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

    reactReact

    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.