Skip to content

Commit

Permalink
fix: fix for fallback images
Browse files Browse the repository at this point in the history
  • Loading branch information
r3dm1ke committed Jan 10, 2020
1 parent da9d4a1 commit d825375
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions autoHeightImageWithErrorFallback.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ function ErrorableImage(props) {
return (
<AutoHeightImage
source={shouldUseFallbackSource ? fallbackSource : source}
onError={(error) => {
onError={(_e) => {
// if an error hasn't already been seen, try to load the error image
// instead
if (!error) {
setError(true);
}

// also propagate to error handler if it is specified
onError && onError(error);
onError && onError(_e);
}}
{...rest}
/>
Expand Down

0 comments on commit d825375

Please sign in to comment.