Created
April 30, 2019 11:55
-
-
Save beatlecz/d212625d457d5103f32252d3edffb3cb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const valSchema = Yup.lazy(values => { | |
let validation = { | |
// put your non dynamic validation here | |
} | |
if (values.somethig) validation = { | |
...validation, | |
somethingBaseVal: Yup.object().shape({ | |
// put dynamic validation | |
}) | |
} | |
return validation | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment