re: Notes on TypeScript: Inferring React PropTypes VIEW POST

FULL DISCUSSION
 

Thank you for your amazing article!! 👏
One question: how do you manage callback props? The solution above does not help with them because the proptypes does not allow to manage them effectively. For example, I could have this ComponentProps type in my component

export interface ComponentProps {
  handleCheckboxChange: (id: string, checked: boolean) => void;
}

how could I update the InferPropTypes type to be prompted by TS if I pass a callback with a wrong signature?
Thank you so much

 

Thanks for the kind words!
I will have a closer look tomorrow and try to provide more insights if possible.

code of conduct - report abuse