Issue
where can I write the alert function in this case, i have form with onSubmit to send email.
<form ref={form} onSubmit={sendEmail} >
Solution
It can be solved in the following way:
const sendEmail = (e) => {
e.preventDefault()
window.alert(“Alert text”)
}
<form ref={form} onSubmit={sendEmail} />
Don't forget to create an input.
Answered By - Elue Wisdom
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.