Skip to content

Commit

Permalink
add keys in image renderer (#1209)
Browse files Browse the repository at this point in the history
  • Loading branch information
IzaacAyelin authored Apr 17, 2024
1 parent 56273a6 commit ed8f457
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions packages/gallery/src/components/item/imageRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,19 @@ const ImageRenderer = (props) => {
id={`multi_picture_${props.id}`}
key={`multi_picture_${props.id}`}
>
{props.src.map((src) =>
{props.src.map((src, index) =>
src.forPrinting ? (
<PrintOnlyImageSource srcSet={src.dpr} type={`image/${src.type}`} />
<PrintOnlyImageSource
key={`print-only-image-${index}`}
srcSet={src.dpr}
type={`image/${src.type}`}
/>
) : (
<source srcSet={src.dpr || src.url} type={`image/${src.type}`} />
<source
key={`image-source-${index}`}
srcSet={src.dpr || src.url}
type={`image/${src.type}`}
/>
)
)}
<img
Expand Down

0 comments on commit ed8f457

Please sign in to comment.