Added missing getItemLayout prop to SectionList

This commit is contained in:
Sverre Johansen
2017-10-27 11:23:19 +02:00
committed by GitHub
parent 5761cfc6f2
commit 54c6d449f2

View File

@@ -3743,6 +3743,18 @@ export interface SectionListProperties<ItemT> extends ScrollViewProperties {
*/
extraData?: any
/**
* `getItemLayout` is an optional optimization that lets us skip measurement of dynamic
* content if you know the height of items a priori. getItemLayout is the most efficient,
* and is easy to use if you have fixed height items, for example:
* ```
* getItemLayout={(data, index) => (
* {length: ITEM_HEIGHT, offset: ITEM_HEIGHT * index, index}
* )}
* ```
*/
getItemLayout?: (data: SectionListData<ItemT>[] | null, index: number) => {length: number, offset: number, index: number}
/**
* How many items to render in the initial batch
*/