Created
August 6, 2020 01:53
-
-
Save pipopotamasu/541c33836f883bfb42a63533e696a142 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 schema = yup.object().shape({ | |
users: yup.array( | |
yup.object().shape({ | |
name: yup.string().required('name is required.'), | |
email: yup | |
.string() | |
.required('email is required.') | |
.email('invalid email type.') | |
.test('email-dup', 'duplicated email', () => { /* バリデーションロジック */ }) // 新しく追加 | |
}), | |
), | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment