saleel / react-native-super-grid

Responsive Grid View for React Native
MIT License
1.43k stars 153 forks source link

onViewableItemsChanged ERROR! #186

Closed mikepng closed 2 years ago

mikepng commented 2 years ago

Hi, When trying to use onViewableItemsChanged on SectionGrid it returns the error:

rowItems.map is not a function. (In 'rowItems.map(function (rowItem, rowItemIndex) {
          return keyExtractor(rowItem, rowItemIndex);
        })', 'rowItems.map' is undefined)

The prop that i added to the SuperGrid is:

onViewableItemsChanged={({ viewableItems, changed }) => console.log(viewableItems) }

saleel commented 2 years ago

Hi @mikepng

Sorry for the delay to reply. That is strange, as the prop would be passed down to SectionGrid. I tried this prop in the example SectionGrid code and it works as expected. I believe its something else in your code that is causing the issue. If you can create a Expo Snack with your sample code that has the error, I can help you debug.

saleel commented 2 years ago

Closing due to inactivity