How is the type of the onclick event ? #1928
Answered
by
army-u8
TheElegantCoding
asked this question in
Q&A
-
Hello I have a question about the on-click method of the button, the event doesn't have a type, the type is something like this, is that the real type? it should be one type only for the event const handleClick = (event: MouseEvent & {
target: Element;
currentTarget: HTMLButtonElement;
}) =>
{
handleRipple(event);
if(onclick)
{
onclick();
}
};
return (
<button
onclick={handleClick}
>
{children}
</button>
); |
Beta Was this translation helpful? Give feedback.
Answered by
army-u8
Oct 20, 2023
Replies: 1 comment
-
const handleClick: JSX.EventHandler<HTMLButtonElement, Event> |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
TheElegantCoding
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
const handleClick: JSX.EventHandler<HTMLButtonElement, Event>