Here is my template and code:
const submit = (event: React.MouseEventHandler<HTMLButtonElement>) => {
console.log("submitted");
};
template:
<input type="password" defaultValue={repass} onChange={(e) => handleChange(e)} placeholder="userPassword Repeat" name="userPasswordRep" />
<button disabled={isSubmit} onClick={submit(event)}>
Sign Up{" "}
</button>
here handleChange
works. even the button
works if I return using another function. but need know why can't we directly call the submit
method from template, what is behind?
getting error and warnings:
'event' is deprecated.ts(6385) Unexpected use of 'event'.