Skip to content

Commit

Permalink
Slideshow block: Modifying Slideshow block key indexes to prevent sam…
Browse files Browse the repository at this point in the history
…e key notice (#39821)
  • Loading branch information
coder-karen authored Oct 21, 2024
1 parent 712c563 commit 8a7e99f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: other

Slideshow block: fix console warning related to images with the same key.
Original file line number Diff line number Diff line change
Expand Up @@ -136,14 +136,14 @@ class Slideshow extends Component {
ref={ this.slideshowRef }
>
<ul className="wp-block-jetpack-slideshow_swiper-wrapper swiper-wrapper">
{ images.map( ( { alt, caption, id, url } ) => (
{ images.map( ( { alt, caption, id, url }, index ) => (
<li
className={ clsx(
'wp-block-jetpack-slideshow_slide',
'swiper-slide',
isBlobURL( url ) && 'is-transient'
) }
key={ id ? id : url }
key={ id ? `${ id }-${ index }` : `${ url }-${ index }` }
>
<figure>
<img
Expand Down

0 comments on commit 8a7e99f

Please sign in to comment.