i can’t make the syntax below do what I expected it to.
When I go to my app and type in the input an email address that does meet the criteria I defined with regex, I still get the error message "Not a valid email address".
Does anyone have any idea what’s wrong with my code? Thank you!
const [emailSignUpErrorMessage, setEmailSignUpErrorMessage] = useState("");
>Solution :
I think you’re using match() method incorrectly
You should pass regex inside like email.match(regex)
if (email.match(<your_regex>)) {
// Don't show validation error
} else {
// Show validation error
}

