I came across this error when creating a higher order component that took in a React component defined by a pure arrow function. The result was an error on the callsite of the HOC: Callable signature not found in statics of React$Component.
It seems as though the definition of a React$Component requires it to be a class with certain statics defined, but a pure function that takes in props and renders a renderable is also a React component. Is there another type definition that could better encompass this case rather than React$Component?
I've boiled it down here in an example. Let me know if you need more info here!
https://flow.org/try/#0PQKgBAAgZgNg9gdzCYAoAlgWwA5wE4AuYASgKYCGAxkVHnJmAOR4XWMDcqqlcAdgM5EAEgHkAwuigBPMAF4wAHgAKdbPwBcyAHwAKVGDBj6uXqV4FNYmOX78FZKgQB0RnHzMEFIADRgVcNV8QLS1vfTBHdD5NHX81AEo5LTAANzh0ABNURNlkymtbMFIADwIzDP4SVmdXEw8vXzj+IOSAb3CeN1NzABFMgFk4AFdzHUT2gwNIvh0CAAt0fidsVX54zgMAX3CWXgzSPDGwCYMASBYCIbxeRVr3c2OnJ-nF5dXNsGAtdjBw7e3JoDJtw+IIwABleikO7dIjyUQSaR6AwrAKVXJgVFqJyUBYwDK7MIo1ZJMA8ARwGCkJzwADmOixazC6yAA
You can use type like this:
type ReactComponent<Props> = Class<React.Component<*, Props, *>> | (Props) => React$Element<any>;
Most helpful comment
You can use type like this: