Reputation: 805
In the Flow documentation, the React Type Reference article mentions various Flow types exported by the React module.
When digging into React's code, I cannot find any of those type definitions. Therefore, I do not understand how Flow can effectively parse them.
What am I missing here ?
Upvotes: 1
Views: 1155
Reputation: 1852
As I understand this - Flow supports React types natively. All react types are inside the Flow source code.
Upvotes: 0
Reputation: 895
The definitions can be viewed in React type definitions
There is also a handy cheat sheet here for quick reference.
Upvotes: 1
Reputation: 2032
You can find some detailed discussion here:
https://medium.com/flow-type/even-better-support-for-react-in-flow-25b0a3485627
For React native you can do:
// @flow
import { StyleSheet } from 'react-native';
type Props = {
style?: StyleSheet.Styles | Array<StyleSheet.Styles>
};
Upvotes: 0