I'm tying to type Component's props, where func
could be any function passed down from it's parent
interface TProps {
func?: Function
children?: ReactNode
}
Component:
return (
<button
onClick={props.func}
>
{props.children}
</button>
)
But I'm getting the following error:
Argument of type 'Function | undefined' is not assignable to parameter of type '((value: void) => void | PromiseLike) | null | undefined'.
What type should I use to define that func
equals any function?