From 54c6d449f27fc5a629cf24cebeeed00e4f7c2c5f Mon Sep 17 00:00:00 2001 From: Sverre Johansen Date: Fri, 27 Oct 2017 11:23:19 +0200 Subject: [PATCH] Added missing getItemLayout prop to SectionList --- types/react-native/index.d.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/types/react-native/index.d.ts b/types/react-native/index.d.ts index 2dcec3f6eb..58af56a5ac 100644 --- a/types/react-native/index.d.ts +++ b/types/react-native/index.d.ts @@ -3743,6 +3743,18 @@ export interface SectionListProperties 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[] | null, index: number) => {length: number, offset: number, index: number} + /** * How many items to render in the initial batch */