Skip to content

Commit

Permalink
Add image key when shouldUseFasterImage is used
Browse files Browse the repository at this point in the history
  • Loading branch information
christianbaroni committed Jun 11, 2024
1 parent 28c2a7e commit d4d0960
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/components/images/ImgixImage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,12 @@ class ImgixImage extends React.PureComponent<MergedImgixImageProps, ImgixImagePr
const Component = maybeComponent || (shouldUseFasterImage ? FasterImageView : FastImage);

const conditionalProps = shouldUseFasterImage
? { onError: this.props.onError, onLoad: undefined, onSuccess: this.props.onLoad }
? {
key: `${typeof source === 'object' && source.uri ? source.uri : ''}` || undefined,
onError: this.props.onError,
onLoad: undefined,
onSuccess: this.props.onLoad,
}
: {
key: `${typeof source === 'object' && source.uri ? source.uri : JSON.stringify(source)}-${retryCount}`,
onError: this.handleError,
Expand Down

0 comments on commit d4d0960

Please sign in to comment.