Skip to content

Commit 71d7d68

Browse files
jsfufacebook-github-bot
jsfu
authored andcommitted
fix display problems when image fails to load (#25969)
Summary: This problem was also affecting Fabric and was fixed in D16708532. When the image resource is changed and the new image resource fails to load, we expect the display image to fail to load, but the image still shows the image that was successfully loaded last time. ## Changelog [iOS] [Fixed] - fix display problems when image fails to load Pull Request resolved: #25969 Test Plan: This is catalyst playground with following code P78264143. TLDR of the code, it sets URL <Image> that is 404. {F175486515} Reviewed By: makovkastar Differential Revision: D16783330 Pulled By: sammy-SC fbshipit-source-id: 1cb488590ce15d957357f32a73ebf8df6cccf4cd
1 parent 639da37 commit 71d7d68

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Libraries/Image/RCTImageView.m

+4
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,10 @@ - (void)imageLoaderLoadedImage:(UIImage *)loadedImage error:(NSError *)error for
347347
}
348348

349349
if (error) {
350+
RCTExecuteOnMainQueue(^{
351+
self.image = nil;
352+
});
353+
350354
if (_onError) {
351355
_onError(@{ @"error": error.localizedDescription });
352356
}

0 commit comments

Comments
 (0)