Flow: Document the `ReactClass` type

Created on 14 Oct 2016  路  6Comments  路  Source: facebook/flow

In the React HOC documentation you use the ReactClass type. No document exists on this special type.

Could you please add some documentation on it?

react

Most helpful comment

Probably it's better to wait until it's fixed, it doesn't really work at the moment

All 6 comments

Probably it's better to wait until it's fixed, it doesn't really work at the moment

I can understand not everything is working yet, but a short explanation would save thousands of developers.

ReactClass is dead. Long live ReactClass.

I was expecting to find the proper type to use here so I thought I'd share it for others with the same expectation.

React.ComponentType<Props>

This is the type you want to use for functions that receive or return React components such as higher-order components or other utilities.

@Zhouzi I think it should be React$ComponentType<Props>.

For a full list of non-public built-in Flow types, c.f. https://www.saltycrane.com/flow-type-cheat-sheet/latest/

Was this page helpful?
0 / 5 - 0 ratings