Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions Libraries/Image/Image.android.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,10 @@ var Image = React.createClass({
* Invoked when load either succeeds or fails
*/
onLoadEnd: PropTypes.func,
/**
* Invoked when load fails
*/
onError: PropTypes.func,
/**
* Used to locate this view in end-to-end tests.
*/
Expand Down Expand Up @@ -248,10 +252,10 @@ var Image = React.createClass({
sources = source;
}

const {onLoadStart, onLoad, onLoadEnd} = this.props;
const {onLoadStart, onLoad, onLoadEnd, onError} = this.props;
const nativeProps = merge(this.props, {
style,
shouldNotifyLoadEvents: !!(onLoadStart || onLoad || onLoadEnd),
shouldNotifyLoadEvents: !!(onLoadStart || onLoad || onLoadEnd || onError),
src: sources,
loadingIndicatorSrc: loadingIndicatorSource ? loadingIndicatorSource.uri : null,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,9 @@ public void setLoadHandlersRegistered(ReactImageView view, boolean shouldNotifyL
ImageLoadEvent.eventNameForType(ImageLoadEvent.ON_LOAD),
MapBuilder.of("registrationName", "onLoad"),
ImageLoadEvent.eventNameForType(ImageLoadEvent.ON_LOAD_END),
MapBuilder.of("registrationName", "onLoadEnd"));
MapBuilder.of("registrationName", "onLoadEnd"),
ImageLoadEvent.eventNameForType(ImageLoadEvent.ON_ERROR),
MapBuilder.of("registrationName", "onError"));
}

@Override
Expand Down