Skip to content
Permalink
Browse files

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
  • Loading branch information...
sammy-SC authored and facebook-github-bot committed Aug 12, 2019
1 parent 5edd1c6 commit 5cde7d29a395cae22eacea553453df60a41e2c37
Showing with 2 additions and 0 deletions.
  1. +2 −0 React/Fabric/Mounting/ComponentViews/Image/RCTImageComponentView.mm
@@ -177,6 +177,8 @@ - (void)didReceiveFailureFromObserver:(void *)observer
return;
}

_imageView.image = nil;

std::static_pointer_cast<const ImageEventEmitter>(_eventEmitter)->onError();
}

0 comments on commit 5cde7d2

Please sign in to comment.
You can’t perform that action at this time.