Description
Description
Flatlist or VirtualizedList Scroll lags horribly after 30-40 rows . I am fetching the same data on onEndReached . Upto 30 rows its looks fine , but after that scrolling drops several frames . When I disable virtualization , scroll becomes normal but but responsiveness goes away . I tried disabling virtualizing on scrolling velocity this way .
isVirtualizationTrue(e){
var dOffset=(e.nativeEvent.contentOffset.y- this.state.lastOffset)
var dt=(e.timeStamp-this.state.lastTimeStamp)
var velocity = dOffset/dt
var isInstant=velocity-this.state.lastVelocity>.01
if(velocity<1 && !isInstant){
return false
}
if(velocity>1){
return true
}
if(velocity <.25){
return true
}
}
But again , there's problem for the unmounted Component that are removed from the views , which takes long time to show up again .
Is there any way to improve the scroll performance ?
Here's my sample code
<FlatList
shouldItemUpdate={(props,nextProps)=>
{
return props.item!==nextProps.item
} }
onEndReached={this.onRefresh.bind(this)}
onEndReachedThreshold={200}
onRefresh={this.onRefresh.bind(this)}
refreshing={this.props.Feed.isFetching }
data={this.state.items}
renderItem={this.renderItem.bind(this)} />
My data is sort of large and nested object by the way .
And data contains High quality Images . Per row there's two Items . But I implemented it without using numColums for testing with Virtualizedlist instead of Flatlist , but same result . Is it due to the High quality Image or I am doing something wrong ?
Additional Information
- React Native version: 0.43.2
- Platform: Android
- Development Operating System: Windows 10