Closed jaulz closed 8 years ago
This is happening because your type annotation is specifying an instance of App
, not the App
class itself. One of these should work:
export default decorator(componentToDecorate:Class<App>):Function => DecoratedComponent
// or...
export default decorator(componentToDecorate:typeof App):Function => DecoratedComponent
I would like to check the class of a parameter in a function i.e. check that it is of a specific class.
However if I try to run
decorator(App)
in my tests it fails:App is in this case an ES6 class that extends the React Component class. I ran through all the flow documentation but could not find what's wrong here. Is there a simple solution for this?
Many thanks!