Skip to content

Commit 5cde7d2

Browse files
sammy-SCfacebook-github-bot
authored andcommitted
Fix handling of failed image downloads
Summary: If you have following scenario 1. Have <Image> component with valid URL 2. Due to user action set <Image> to incorrect URL (something that 404s) Currently 1st image stay visible to the user. This is the case for both Fabric and Paper. Paper is being fixed -> #25919 Reviewed By: fkgozali Differential Revision: D16708532 fbshipit-source-id: ffdea5421faead4730e7b117a3b9f6e21869da70
1 parent 5edd1c6 commit 5cde7d2

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

React/Fabric/Mounting/ComponentViews/Image/RCTImageComponentView.mm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,8 @@ - (void)didReceiveFailureFromObserver:(void *)observer
177177
return;
178178
}
179179

180+
_imageView.image = nil;
181+
180182
std::static_pointer_cast<const ImageEventEmitter>(_eventEmitter)->onError();
181183
}
182184

0 commit comments

Comments
 (0)