I’m finding it really difficult to work with flow in an expo app, since the fork of RN used by expo is locked to flow 0.51. I upgraded my project 0.52 without error, but going to 0.53 (the minimum version supported in flow.org’s “try flow” tool), generates a few hundred errors.
So my first question is about the delay in supporting newer versions of flow that matches the documentation for react on their site (Components | Flow is unusable with an expo project so far as I can tell).
Second question is, how can get a component typed with the version of flow listed? Even something as simple as
type Props = {
initialDisplayMode?: displayMode
};
type State = {
displayMode: string
};
class List extends React.Component<*, Props, State> {
constructor(props:Props) {
super(props)
}
render() {
return (
<Text>{this.state.displayMode}</Text>
)
}
}
fails to validate, with the following error:
Error: List.js:21
21: class List extends React.Component<*, Props, State> {
^^^^^ object type. This type is incompatible with
21: class List extends React.Component<*, Props, State> {
^^^^^ undefined. Did you forget to declare State?
Error: List.js:21
21: class List extends React.Component<*, Props, State> {
^^^^^ undefined. Did you forget to declare State?. This type is incompatible with
21: class List extends React.Component<*, Props, State> {
^^^^^ object type
Thanks!