You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was trying to decrease the number of re-renders when items where added to the list after onStartReached or onEndReached were called. There were unecessary re-renders of already created items (at least in my view, maybe there is a reasoning for that), so I wanted only new items to call the renderItem prop passed to the Flatlist and improve the list rendering.
For that, I proposed a PR #1 using React.memo and React.useCallback to memoize the already rendered items and only call the renderItem to the new items on the list. Hope it'll be helpful somehow.
The text was updated successfully, but these errors were encountered:
CarlosRafael22
changed the title
Decrease the number of re-renders of items in the list when adding new ones
Decrease number of re-renders on renderItem
Feb 24, 2021
I was trying to decrease the number of re-renders when items where added to the list after onStartReached or onEndReached were called. There were unecessary re-renders of already created items (at least in my view, maybe there is a reasoning for that), so I wanted only new items to call the
renderItem
prop passed to theFlatlist
and improve the list rendering.For that, I proposed a PR #1 using React.memo and React.useCallback to memoize the already rendered items and only call the
renderItem
to the new items on the list. Hope it'll be helpful somehow.The text was updated successfully, but these errors were encountered: