react-native-big-list
react-native-big-list copied to clipboard
Question: onViewableItemsChanged support?
Do you plan on adding onViewableItemsChanged prop or similar, for detecting which items are currently visible?
Hi @zchwyng , added at the moment and I need to do some tests before release it. Probably on next days after some tests I will release it.
On the other hand viewabilityConfig
property would not be of any help in this library because the logic behind is completly different.
Cool. I really like to test this as a RecyclerList replacement :)
Added on 1.3.8
as experimental feature. Let me know if you have any problems if you find a problem report what it returns and what it should return.
I've done some initial testing on iOS, and am having an issue where handleViewableItemsChanged doesn't trigger for the first item in the list. (I'm having a header that's higher than the device, so the first item isn't visible at first.) It also just gives me the latest viewable item in viewableItems even though I'm expecting two items currently visible. Could be something wrong on my end though... Other than that it looks really good!
Also it seems like it stops rendering the header when renderEmpty is applied.
Hi @zchwyng
I've done some initial testing on iOS, and am having an issue where handleViewableItemsChanged doesn't trigger for the first item in the list. (I'm having a header that's higher than the device, so the first item isn't visible at first.) It also just gives me the latest viewable item in viewableItems even though I'm expecting two items currently visible. Could be something wrong on my end though... Other than that it looks really good!
This should be solved on 1.3.12
.
Also it seems like it stops rendering the header when renderEmpty is applied.
This was intentional. Anyway I changed it and now as default the header and footer are visibile even with empty item and I added some props to let hide marginals header and footer on empty.
Note: The empty element, if you render the header and footer, can no longer be stylized with "flex: 1" but is only "height: auto", so if you need to change the height, you need to specify it without using percentages or flex.
The viewabilityConfig will be great, on my system i have a screen like reels and with this great package the videos start when it's not on the screen because the couple pixels. With this option we can set viewAreaCoveragePercentThreshold :50 and will works very well
Thank you