mirror of
https://github.com/status-im/react-native.git
synced 2025-01-09 17:15:54 +00:00
71bf8a3e48
Summary: Some apps are complaining about flashing images when performing navigation transitions. An example issue would be: 1. Load a master list view with many images 2. Click on an image to go to a detail view 3. Go back to the master list view At step (3), users see a number of images flash from a placeholder image back to the final image because `-[RCTImageView didMoveToWindow]` calls `clearImage` when the image view exits the view hierarchy between (1) and (2) and calls `reloadImage` (which sets the image property asynchronously) when the image view re-enters the view hiearchy between (2) and (3). This diff fixes the issue by being less aggressive about clearing image contents. It only clears image contents when the app receives a memory warning or the app goes into the background. For comparison, CKNetworkImageComponent in ComponentKit doesn't have this purging behavior at all. Reviewed By: javache Differential Revision: D3325009 fbshipit-source-id: efca10099cdfdb49afbb3f550854d4b8a40511d0