If have this simple SectionList definition in my code:
const s = (
<SectionList
renderItem={({ item }) => <Text>abc</Text>}
renderSectionHeader={({ section }) => <Text>abc</Text>}
sections={[{ data: [1, 2, 3], title: 'abc' }]}
/>
);
And flow generates this error message which refers to the whole "tag block" (it is actually copy pasted from VSCode):
[flow] props of React element `SectionList` (This type is incompatible with See also: React element `SectionList`)
What is happening here?
EDIT I am using
flow-bin: 0.56.0
react: 16.0.0
react-native: 0.49.1
EDIT2 So the example can be reduced to this simple line (without impacting the error message):
<SectionList sections={[]} />;
EDIT3 I just discovered that flow complains about several types that are defined in the React Native library (mainly about missing type arguments for generic types). I am wondering if I should use an older flow-bin version. Is there a compatibility table for React Native and flow?
^0.53.0as its flow-bin dependency version. Try reverting to v0.53.0. github.com/facebook/react-native/blob/0.49-stable/package.json - Ross Allen