deanmcpherson / react-native-sortable-listview

Drag drop capable wrapper of ListView for React Native
MIT License
917 stars 235 forks source link

Rows disappear when navigate away #151

Closed ttys026 closed 6 years ago

ttys026 commented 6 years ago

Hello all, As the video shows below, I have a tab navigator as root nav that contains 4 tabs and each tab contains a stack navigator. If I navigate to a page in other tab's nested stack, when I go back, all the list items will disappear, unless I scroll the screen to make it re-render. The component doesn't unmount, because it still have my scrolling position.

My temp work around is to pass a timestamp to the listview "key" props each time I navigate to that page, so it will force to update the whole list. But by that way, I will lose the scrolling position and it hurt the performance a lot.

https://drive.google.com/file/d/1D7CaZ1k4DITlBql0nB96nLofIFFjFTnl/view?usp=sharing

I know this package is inactive for a long time just trying to see if I get luck here. If anybody faces the same problem and has a better way to solve it I'll be very appreciate.

ttys026 commented 6 years ago

I found out this is a issue of react native ListView, if props and state update while the ListView is in background will cause the list render blank. More details in https://react-native.canny.io/feature-requests/p/listview-doesnt-render-rows-until-scroll

Since ListView is deprecated, there is nothing to do with this package, the best way is to switch to FlatList.