Mindinventory / react-native-stagger-view

Staggered Grid View is a type of layout that is used to display images and posts. As you see in various social platforms such as Pinterest and many more. (staggered, masonry, quilted, woven, etc.).
MIT License
85 stars 10 forks source link

Added OnEndReached and getting Error: Rendered more hooks than during the previous render. #6

Closed jsonpreet closed 1 year ago

jsonpreet commented 1 year ago

https://github.com/jsonpreet/pinsta-app/blob/master/app/(app)/index.tsx

PremshankarMI commented 1 year ago

Thank you @jsonpreet for addressing this issue.

Screenshot 2023-04-10 at 6 09 18 PM

The problem with the renderItem prop. Specifically, it appears that passing a component as a function to renderItem is causing the state to not be properly recycled.

To solve this issue, you can try passing the component as a return value in the renderItem function instead. This should help ensure that the state is properly recycled.

Rather than being passed as a function directly. This should help ensure that the state is properly recycled, and hopefully solve the issue you're experiencing.

jsonpreet commented 1 year ago

@PremshankarMI

Thank You for Support!