Skip to content

Commit 6d08c4c

Browse files
authored
Merge pull request DefinitelyTyped#23648 from sarahscott/flatlist-scrolltoindex
[react-native] Updated scrollToIndex method of FlatList
2 parents 1967547 + 92cd43d commit 6d08c4c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

types/react-native/index.d.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3643,11 +3643,11 @@ export interface FlatListStatic<ItemT> extends React.ComponentClass<FlatListProp
36433643
scrollToEnd: (params?: { animated?: boolean }) => void;
36443644

36453645
/**
3646-
* Scrolls to the item at a the specified index such that it is positioned in the viewable area
3647-
* such that `viewPosition` 0 places it at the top, 1 at the bottom, and 0.5 centered in the middle.
3648-
* May be janky without `getItemLayout` prop.
3646+
* Scrolls to the item at the specified index such that it is positioned in the viewable area
3647+
* such that viewPosition 0 places it at the top, 1 at the bottom, and 0.5 centered in the middle.
3648+
* Cannot scroll to locations outside the render window without specifying the getItemLayout prop.
36493649
*/
3650-
scrollToIndex: (params: { animated?: boolean; index: number; viewPosition?: number }) => void;
3650+
scrollToIndex: (params: { animated?: boolean; index: number; viewOffset: number; viewPosition?: number }) => void;
36513651

36523652
/**
36533653
* Requires linear scan through data - use `scrollToIndex` instead if possible.

0 commit comments

Comments
 (0)