-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Re-Render takes some time #17
Comments
I'm also experiencing this. It can take a few seconds once it's scrolled to the top to render the items. |
is it after refresh or if you scroll fast? |
Only tested this on iOS so far by tapping the status bar clock to return to the top of the list. |
I noted the same issue on iOS. Interestingly, the React FlatList component wasn't having any performance issues on iOS but was extremely slow on Android. I created a new PlatformFlatList component that serves OptimizedFlatList on Android and it worked great - including on relatively underpowered Android devices that were really struggling. https://gist.github.com/thame/a7e5c61e7bb3a6d56406db37da090a76 |
@thame, feel free to create a PR. I think that this solution also should be implemented. |
@Stoffern Would love to, complete git/React noob so no idea how :) |
@xempie is this issue only related to ios or android to? |
@Stoffern Sorry for the delay, I'm subscribed now. The performance issue I was having was mostly on Android (which is why I preferred the basic FlatList on iOS). |
Quick and patchy fix for this is to never hide the first items. Make sure to add enough to fill the screen but not much more. So in our case maximum items is 3, so we will never hide the first 3 items to avoid this 2-3 seconds white screen when scrolling to top. So the _updateItem() function on OptimizedFlatList.js would look like this:
So basically: just wrapping the function content within an IF stating which items not to hide. |
This is still happening. Not fixed yet. |
Thanks...! This solved another issue of not showing the 1st item when data resets (Refresh func). |
I tried this and seems it fixed some of the FlatList issues but I noticed when I scroll back (top or bottom) (specially when I'm using images) it takes some time to re-render and display the blocks.
So it would be good if it has an offeset to pre-load some items before displaying in viewport in order to prevent the blank space between blocks which doen't look good.
Any idea?
The text was updated successfully, but these errors were encountered: