Closed hotaryuzaki closed 1 year ago
the solution is i have to add key manually in my RenderItem
<RenderItem
key={`${index}-${item.id}`} // ADD THIS
index={index}
item={item}
onPress={_onPressCheckbox}
selectedAlbum={selectedAlbum}
checkedIndex={checkedIndex != -1 ? true : false}
/>
This does help indeed, but now I got plenty of blank spaces when scrolling (not even fast scrolling). This is even worse than using FlatList or VirtualizedList
the solution is i have to add key manually in my RenderItem
<RenderItem key={`${index}-${item.id}`} // ADD THIS index={index} item={item} onPress={_onPressCheckbox} selectedAlbum={selectedAlbum} checkedIndex={checkedIndex != -1 ? true : false} />
Wow, really did work for me, thank you
Current behavior
i have gallery with 3 columns, my script are below:
and here is the renderItem, i create RenderItem component so it just rerender for checked item.
here is RenderItem component
the problem is when i scroll down the gallery and scroll back to the top the order of the images is changing. i see a blank space then it show the incorrect order, look the number inside the item image. when i create console.log in renderItem, it always calls in every scroll. it's like rerender, maybe that is why i look a blank screen
here is the gallery before i scroll down
and here is the gallery after i scroll down and scroll back to the top:
Expected behavior
I changed to the standard FlatList by React Native and there is no issue. even after pagination called the images gallery still in order. so my conclusion this issue is cause by FlashList
To Reproduce
maybe you can copy paste my script above
Platform:
Android
Environment
1.4.0