Encountering some difficulties with FlatList as I try to render numerous cells on the screen.
Please refer to the following image first: Image
Let's consider the scenario:
- A map consisting of 80 rows x 80 columns = 6400 cells
- A toggle button to enable and disable scroll functionality
The challenges faced are as follows:
- The rendering of the map is extremely slow; during the initial view, the app needs to call renderItem approximately 2000 times before users can proceed with their actions
- I have attempted to adjust the
windowSize
andinitialNumToRender
, but it doesn't seem to alleviate the issue - Upon toggling the
Enable/Disable Scroll
button, the app once again makes around 2000 renderItem calls, even though I have set theextraData
to only includecellList
My question is:
- If anyone has any solutions or workarounds for this particular case, please share your ideas. Any insight would be greatly appreciated.
Thank you in advance!
Here is a snippet of the code:
Map implementation using Flatlist
[Code sample removed for brevity]
Cells within the map, referred to as "Stack"
[Code sample removed for brevity]