FlatList big data renderItem is called for every elements #33940
Labels
Component: FlatList
Impact: Performance
When the issue impacts the app running or build performance
Priority: Low
Stale
There has been a lack of activity on this issue and it may be closed soon.
Type: Old Architecture
For issues related to the old architecture
Description
I have a list of data with 36000 elements i have already implemented shouldComponentUpdate on the item so the item render is only called once
but my problem is that renderItem is called several times
for example when i scroll to 20000 element, renderItem is called for the first 19999 elements and the flat list takes time to load new element
and when i'm on the 20000 element for example and i do a setState all the 19999 are loaded again
how can i resolve this big problem of FlatList please ?
I use disableVirtualization = {true} because with false i'm getting blank space
"react": "16.13.1", and "react-native": "0.63.3",
Version
0.63.3
Output of
npx react-native info
System:
OS: macOS 12.3.1
CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
Memory: 1012.89 MB / 16.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 12.14.0 - /usr/local/bin/node
Yarn: Not Found
npm: 8.1.4 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.11.2 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 15.0, DriverKit 20.4, macOS 11.3, tvOS 15.0, watchOS 8.0
Android SDK: Not Found
IDEs:
Android Studio: 4.1 AI-201.8743.12.41.6953283
Xcode: 13.0/13A233 - /usr/bin/xcodebuild
Languages:
Java: 15.0.1 - /usr/bin/javac
Python: 3.9.0 - /usr/local/bin/python
npmPackages:
@react-native-community/cli: Not Found
react: 16.13.1 => 16.13.1
react-native: 0.63.3 => 0.63.3
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found
Steps to reproduce
.
Snack, code example, screenshot, or link to a repository
.
The text was updated successfully, but these errors were encountered: