Closed arabhiar closed 3 years ago
Hi, I am getting an error
deep_email_validatorWEBPACK_IMPORTED_MODULE6default.a.validate is not a function
while trying to hook deep-email-validator with React.
import emailValidator from 'deep-email-validator'; const isEmailValid = async (email) => { return emailValidator.validate(email); }; const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/i; const passwordRegex = /^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#?!@$%^&*-]).{8,}$/g; // const phoneRegex = /^([0]{1}|\+?[234]{3})([7-9]{1})([0|1]{1})([\d]{1})([\d]{7})$/g const validationSchema = yup.object().shape({ email: yup .string() .matches(emailRegex, 'Invalid email.') .test('working-email', 'Must be an working email', async (value) => { const res = await isEmailValid(value); return res.valid; }) .required('Email is required.'), password: yup .string() .required('Password is required.') .matches( passwordRegex, 'Password must be min 8 characters, have 1 special character[#?!@$%^&*-], 1 uppercase, 1 lowercase and 1 number.' ), confirmPassword: yup .string() .test('password-match', 'Passwords must match.', function (value) { return this.parent.password === value; }), `});
Please look into it @mfbx9da4
This is not compatible with the browser
Okay, then I can only use this package with the node app.
Hi, I am getting an error
while trying to hook deep-email-validator with React.
Please look into it @mfbx9da4