Answer the question
In order to leave comments, you need to log in
onClick event only fires after two clicks?
There is such input
<input name={email} onClick={onEmailClick} onChange={setMail} />
const onEmailClick = (e) => {
e.preventDefault()
onEmailClickedSet(true);
};
Answer the question
In order to leave comments, you need to log in
You have some mess: onClick={onEmailClick} onChange={setMail}
Why two handlers for one input? Why is it not specified what type of input you have?
The onClick event fires on every click, not after two.
Wang that the onChange event changes something and onClick works as you need only after this change, i.e. from the second time.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question