Fix getItemLayout flow type to include index

Summary:
The index is used to make sure the layout corresponds to the correct index, which can get
out of sync if cell layout is cached and then cells are re-ordered.

Reviewed By: bvaughn

Differential Revision: D4554721

fbshipit-source-id: 9acb37f390a6e40ad89f813b78f81b399ec11e9a
This commit is contained in:
Spencer Ahrens
2017-02-13 18:15:43 -08:00
committed by Facebook Github Bot
parent b2c545dcb6
commit 91bda43e56
3 changed files with 6 additions and 4 deletions
+1 -1
View File
@@ -114,7 +114,7 @@ class MultiColumnExample extends React.PureComponent {
</UIExplorerPage>
);
}
_getItemLayout(data: any, index: number): {length: number, offset: number} {
_getItemLayout(data: any, index: number): {length: number, offset: number, index: number} {
return getItemLayout(data, index);
}
_renderItemComponent = ({item}) => {