I'm making a checkbox React TypeScript component. I need to accept an onChange
function, but all that I know is that it will be a function.
I thought I could use the generic function type:
type Props = {
onChange: Function;
};
However when I try and use it I get an error:
// From Material UI
<CheckboxComponent onChange={onChange}>
Type 'Function' is not assignable to type '(event: ChangeEvent, checked: boolean) => void'.