inaturalist / iNaturalistReactNative

Cross-platform version of the iNat mobile app
MIT License
64 stars 21 forks source link

Prevent visible cell recycling #1456

Open kueda opened 5 months ago

kueda commented 5 months ago

When you scroll through Species view in Explore (or really any grid view), old photos appear briefly before the right photos load. This is apparently something you can control and prevent in iOS (and maybe in Android? This has always been a problem in the native Android app), so the task here is to ensure you can reproduce and research ways to prevent it in RN. I think all of these views are using FlashList, so that's where I'd start.

alexshepard commented 5 months ago

in case it helps, natively in iOS, the way to prevent this is to implement the prepareForReuse() callback on your re-usable views - iOS will calls this method before recycling your table / grid cell views, and you can use that opportunity to set image views to empty, clear text, etc.

kueda commented 4 months ago

Relevant docs: https://shopify.github.io/flash-list/docs/recycling/