Closed kubijo closed 2 years ago
When I have a following prop type definition:
type onChange = { (k: 'subject', v: string): void; (k: 'description', v: string): void; (k: 'canContact', v: boolean): void; (k: 'attachments', v: $File[]): void; }
… I get an object PropType on the component, but the correct one would be a function.
PropType
Warning: Failed prop type: Invalid prop `onChange` of type `function` supplied to `Feedback`, expected `object`.
Would you consider catching this case and generating function PropType?
https://www.typescriptlang.org/docs/handbook/2/functions.html#call-signatures
Will be supported in the next version.
When I have a following prop type definition:
… I get an object
PropType
on the component, but the correct one would be a function.Would you consider catching this case and generating function
PropType
?https://www.typescriptlang.org/docs/handbook/2/functions.html#call-signatures