Design comparison
Solution retrospective
What are you most proud of, and what would you do differently next time?
Use zod to validate email input
const emailSchema = z.string().email();
function isEmailValid(email: string) {
return emailSchema.safeParse(email);
}
const { success } = isEmailValid(email);
if (!success) {
showEmailErrorMsg();
} else {
closeEmailErrorMsg();
}
Community feedback
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord