Skip to content

Commit

Permalink
fix: remove index from component key
Browse files Browse the repository at this point in the history
  • Loading branch information
Valik3201 committed Jan 28, 2024
1 parent caedb45 commit ab1fc3e
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/components/ImageGallery.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,16 @@ class ImageGallery extends Component {
<Row xs={1} sm={2} md={3} lg={4} className="g-4">
{/* Map through the images array and render ImageGalleryItem for each image */}
{images.map(
(
{ id, webformatURL, largeImageURL, tags, user, userImageURL },
index
) => (
({
id,
webformatURL,
largeImageURL,
tags,
user,
userImageURL,
}) => (
<ImageGallery.Item
key={`${index}-${id}`}
key={id}
id={id}
webformatURL={webformatURL}
largeImageURL={largeImageURL}
Expand Down

0 comments on commit ab1fc3e

Please sign in to comment.