我在我的 react native 项目中使用 Flatlist 和 SectionList,我有 300 多行数据。但是,我发现了一个严重的问题,即当我不断向下和向上滚动时,内存使用率越来越高。我怎么解决这个问题?或者我怎样才能释放内存?
我知道这里有一些相关的问题,但我尝试了很多解决方案,但没有一个有效。
举些例子,
1. 我用的是 Pure.component 或者 shouldcomponentUpdate
2.我使用了Flatlist和SectionList的一些props
initialNumToRender={9}
windowSize={10}
maxToRenderPerBatch={2}
removeClippedSubviews={true}
disableVirtualization={true}
getItemLayout={this.getItemLayout}
keyExtractor={(item, index) => item[0]}
extraData={this.state}
有没有其他解决方案可以帮助我解决问题?非常感谢!