cooperka / react-native-immutable-list-view

:scroll: Drop-in replacement for ListView, FlatList, and VirtualizedList.
MIT License
205 stars 30 forks source link

rendering new rows #4

Closed korhaliv closed 7 years ago

korhaliv commented 7 years ago

What is the best approach to avoid re-rendering all rows when new elements get added to the data source? I tried using List, but renderRow gets called for all existing rows when new item is pushed. Using Map solves this issue but I don't know how to order it. In original ListView I was using identities to sort the data set. Like this: cloneWithRows(data, identities)

Thank you.

cooperka commented 7 years ago

Hi @dot3bumpmap, I created a new branch render-audit to try to get to the bottom of this. It looks like you're right -- it's sometimes re-rendering rows and section headers when it shouldn't be. It's probably a bug in my implementation of rowHasChanged or sectionHeaderHasChanged.

I'll try to improve this soon, but in the meantime, feel free to open a PR if you come up with a solution! I'll keep you updated here when I get to working on it.

cooperka commented 7 years ago

@dot3bumpmap I've just released v0.2.x with several significant changes. I also updated the render-audit branch to match, and the issue seems to be fixed! Please let me know if you have any more issues.