sghiassy / react-native-sglistview

SGListView is a memory minded implementation of React Native's ListView
MIT License
743 stars 72 forks source link

Initial render #18

Open fatonramadani opened 8 years ago

fatonramadani commented 8 years ago

Hi, thanks for the awesome work ! I'm still having a problem: on the initial render, every cell is rendered ( basically every cell downloads a lot of stuff from the internet) which causes the memory to go very high. Then when I scroll down, your module makes the off-screen view empty, and I'm memory goes back to a very low level. Then when I go back up again, the memory stays at the same level.

How can I make it not render the off screen views on the initial render ?

sghiassy commented 8 years ago

That's actually how the stock React-Native ListView element works, so it's not really a bug per se, but more sub-optimal behavior.

I think this would be a good performance improvement for sglistview to implement, but currently that's a feature a request and nothing something sglistview optimizes for.

rturk commented 8 years ago

@DrRazor why are you rending every cell upon startup? Even the core ListView allows you to lazy load content from the internet. Simply way to implement this is subscribe to onEndReached and only then fetch more cels.

@sghiassy Assuming the use case described above SGListView will be able to leverage when new cels are loaded lazily? I'm assuming yes, if not please comment.