Last active
May 2, 2020 16:40
-
-
Save andreferi3/d39892c9c876beef8409c575f85a7211 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 Schema = Yup.object().shape({ | |
| password: Yup.string().required("This field is required"), | |
| changepassword: Yup.string().when("password", { | |
| is: val => (val && val.length > 0 ? true : false), | |
| then: Yup.string().oneOf( | |
| [Yup.ref("password")], | |
| "Both password need to be the same" | |
| ) | |
| }) | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment