using zod to validate email

Solution retrospective
In react, we often use onChange
to interact between state and UI. However in semantic HTML, the binding is different. We need to use input
instead of change
.
emailInput.addEventListener("input", (event) => { // fix typescript error const { value: email } = event.target as HTMLInputElement; validateEmail() });
Please log in to post a comment
Log in with GitHubCommunity feedback
No feedback yet. Be the first to give feedback on Zup's solution.
Join 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