I use typescript, react redux.
In the link of material ui, the type definition of onClick event will be an error.
It seems that React.MouseEvent<HTMLAnchorElement, MouseEvent> does not match and an error occurs.
<Link component="button" onClick={(event: React.MouseEvent<HTMLAnchorElement, MouseEvent>) => {handleClick(event)}}>********LINK********</Link>
const handleClick = (event: React.MouseEvent<HTMLAnchorElement, MouseEvent>) => {
event.preventDefault();
}
No error occurs with CSB.
Why am I getting an error?
I would be happy if someone could give me some advice.
■Error(VSCode, ESlint, prettier)
error
error tooltip
function
■Error contents(I'm sorry it's hard to see)
■CSB
From Material UI docs example:
event: React.SyntheticEvent
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With