'Is a Flatlist the most efficient way to render small lists of data?
Currently our application uses a custom refreshing scrollview and the standard JavaScript Array.map method to render our data list. The data contains a list of tasks for a given user and will vary in length from user to user. Some of the results that we are fetching can take some time to load, so instead of fetching them all at once I am trying to stagger the loading to get a perceived boost in responsiveness.
The flatlist seems to be calling the onEndReached method when I only have a small number of results. (not enough to fill the entire screen) This causes an infinite loop in requests to get more data, but naturally there is nothing left on the server to fetch.
I have tried tweaking the onEndReachedThreshold value, but because I don't know how many tasks a given user will have I am struggling to find a number that will work across the board for all use cases.
Is the flatlist the best option for rendering small, limited value result sets or should it be reserved for infinite scrolling use cases where the data will just keep coming in?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
