Why is the `MouseEvent` in the checkbox event handler not generic? Why is the `MouseEvent` in the checkbox event handler not generic? reactjs reactjs

Why is the `MouseEvent` in the checkbox event handler not generic?


You're probably using the DOM MouseEvent. Try using React.MouseEvent<HTMLInputElement> instead.


In order to use React MouseEvent just make sure to add:

import { MouseEvent } from 'react';


You can use SyntheticEvent instead of MouseEvent