I know that it’s possible to write in typescript :
interface props {
onChange: (value:boolean)=>void
}
const MyComp = ({onChange})=>{
return ...
}
// use
const onHandleChange = ()=>{ ...}
<MyComp onChange={()=>onHandleChange()}/>
<MyComp onChange={onHandleChange}/>
I mean without the need to provide ‘value’ if it is not used:
const onHandleChange = (value:boolean)=>{ ...}
<MyComp onChange={(value)=>onHandleChange(value)}/>
<MyComp onChange={onHandleChange}/>
But I didn’t find any official documentation about this TypeScript allowance.
Does anyone have a reference for that?