Skip to content

Instantly share code, notes, and snippets.

@pipopotamasu
Created August 6, 2020 01:53
Show Gist options
  • Save pipopotamasu/541c33836f883bfb42a63533e696a142 to your computer and use it in GitHub Desktop.
Save pipopotamasu/541c33836f883bfb42a63533e696a142 to your computer and use it in GitHub Desktop.
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