From 953c41b3e46ff533ffaa5a512fa29a5d3623dbd1 Mon Sep 17 00:00:00 2001 From: Saleel Date: Fri, 7 Dec 2018 23:08:58 +0530 Subject: [PATCH] Change renderItem API to match like FlatList --- index.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 7f72d22..3b3802c 100644 --- a/index.js +++ b/index.js @@ -55,7 +55,7 @@ class SuperGrid extends React.Component { }); } - // execute onLayout prop if passed + // call onLayout prop if passed if (onLayout) { onLayout(e); } @@ -126,7 +126,12 @@ class SuperGrid extends React.Component { {(rowItems || []).map((item, i) => ( - {renderItem(item, i + (rowItems.rowNumber * itemsPerRow))} + { + renderItem({ + item, + index: i + (rowItems.rowNumber * itemsPerRow), + }) + } ))}