skip to Main Content

Reactjs – Can't assign type to generic prop

Initial simplified question Can't assign onActivityChange type to onChange: type ActivityType = { id: string; name: string; } const onChange = <TOption extends {}>(value: TOption) => { console.log(value); } const onActivityChange = (value: ActivityType) => { console.log(value); } // error…

VIEW QUESTION
Back To Top
Search