mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-11 12:30:18 +00:00
Added missing type cases for ItemSeparatorComponent on react-native FlatList
This commit is contained in:
Vendored
+1
-1
@@ -3491,7 +3491,7 @@ export interface FlatListProperties<ItemT> extends VirtualizedListProperties<Ite
|
||||
/**
|
||||
* Rendered in between each item, but not at the top or bottom
|
||||
*/
|
||||
ItemSeparatorComponent?: React.ComponentClass<any> | null
|
||||
ItemSeparatorComponent?: React.ComponentClass<any> | React.ReactElement<any> | (() => React.ReactElement<any>) | null
|
||||
|
||||
/**
|
||||
* Rendered when the list is empty.
|
||||
|
||||
@@ -208,11 +208,22 @@ InteractionManager.runAfterInteractions(() => {
|
||||
}).then(() => 'done')
|
||||
|
||||
export class FlatListTest extends React.Component<FlatListProperties<number>, {}> {
|
||||
_renderItem = (rowData: any) => {
|
||||
return (
|
||||
<View>
|
||||
<Text> {rowData.item} </Text>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
_renderSeparator= () => <View style={{height: 1, width: '100%', backgroundColor: 'gray'}} />
|
||||
|
||||
render() {
|
||||
return (
|
||||
<FlatList
|
||||
data={[1, 2, 3, 4, 5]}
|
||||
renderItem={(info: { item: number }) => <View><Text>{info.item}</Text></View>}
|
||||
renderItem={this._renderItem}
|
||||
ItemSeparatorComponent={this._renderSeparator}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user