Grokking React Native
Vote

0% completed

​

Deep Dive into FlatList

Mark row 15 of a long FlatList, scroll far down, scroll back, and the mark is gone. This test used a row with its own useState value, and it pressed the row to turn that value on:

after the press: Row 15:on scrolled to row 500: Row 15 is not in the tree scrolled back to the top: Row 15:off

No code reset that state. The row's component was removed from memory while it was far from the screen, and a new component with fresh state took its place on the way back. To use FlatList well, you need to know which rows exist at any moment.

.....

.....

.....

Like the course? Get enrolled and start learning!

Reading Progress

0%


Vote for new content