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'm using the FlatList component to render a collection of images/video components on a phone. When my data gets fetched and passed into the component from redux, all the images make network requests for the uri's I give the components. Because of this I'm getting some frame rate drops and the list becomes jarring.
So I've started using the onViewableItemsChanged prop to keep track of the currently viewed items and only render those components when they enter the view (This behavior is working on its own with android but not iOS). Although has helped to not clog up whatever is making the feed stutter, it still has some frame drops. After implementing PureComponent I passed the FlatList the getItemLayout prop and the onViewableItemsChange callback stops firing off entirely.
Sorry no snack.expo project, flat list doesn't seem to be supported.
If the getItemLayout prop is removed the console log is fired off.
Solution
Any advice on optimization of the flat list to remove frame rate drops and deal with large lists would be fantastic. Just trying to get performance up to speed with large lists of images/ .mp4s using videos.
Additional Information
React Native version: 0.43.2
Platform: both
Development Operating System: MacOS
Dev tools: Xcode: 8.3.1. Android Studio 2.2.3. Same behavior on iPhones 5, 6 and 7.
Edit
It seems the callback is actually firing off now. Not sure what I changed from before but any additional advice on optimizing performance so that the child components are not blocking the UI would be great. Feel free to close this though as the title of the issue is not accurate anymore.
The text was updated successfully, but these errors were encountered:
Description
I'm using the FlatList component to render a collection of images/video components on a phone. When my data gets fetched and passed into the component from redux, all the images make network requests for the uri's I give the components. Because of this I'm getting some frame rate drops and the list becomes jarring.
So I've started using the onViewableItemsChanged prop to keep track of the currently viewed items and only render those components when they enter the view (This behavior is working on its own with android but not iOS). Although has helped to not clog up whatever is making the feed stutter, it still has some frame drops. After implementing PureComponent I passed the FlatList the getItemLayout prop and the onViewableItemsChange callback stops firing off entirely.
Sorry no snack.expo project, flat list doesn't seem to be supported.
Reproduction Steps and Sample Code
If the getItemLayout prop is removed the console log is fired off.
Solution
Any advice on optimization of the flat list to remove frame rate drops and deal with large lists would be fantastic. Just trying to get performance up to speed with large lists of images/ .mp4s using videos.
Additional Information
Edit
It seems the callback is actually firing off now. Not sure what I changed from before but any additional advice on optimizing performance so that the child components are not blocking the UI would be great. Feel free to close this though as the title of the issue is not accurate anymore.
The text was updated successfully, but these errors were encountered: