I am using a flatlist where flow complains about a missing type of the item object members in the renderItem property:
<FlatList
data={data}
ItemSeparatorComponent={() => <View style={styles.listSeperator} />}
renderItem={({ item }) => (
<WaterConsumptionListItem
timeStamp={item.timeStamp}
amount={item.amount}
datatype={item.dataType}
/>
)}
/>
However I have no idea how to typecheck members of item. The complete error I get is:
Cannot get `item.timeStamp` because property `timeStamp` is missing in `String` [1].Flow(InferError)
Cannot get `item.amount` because property `amount` is missing in `String` [1].Flow(InferError)
Cannot get `item.dataType` because property `dataType` is missing in `String` [1].Flow(InferError)
<FlatList data={(data: Array<{ timeStamp: number, amount: number, dataType: string }>)}? - Alex SavinFlatListanditemanddata? Not really enough information here. - Lyle Underwood