Skip to content

Commit

Permalink
Switch to using URL for key
Browse files Browse the repository at this point in the history
The order of images can change
  • Loading branch information
nb committed Jun 11, 2017
1 parent b906822 commit 6b7bf26
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions blocks/library/gallery/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ registerBlockType( 'core/gallery', {

return (
<div className={ `blocks-gallery align${ align } columns-${ columns }` }>
{ images.map( ( img, i ) => (
<GalleryImage key={ i } img={ img } />
{ images.map( ( img ) => (
<GalleryImage key={ img.url } img={ img } />
) ) }
{ focus && images.length > 1 &&
<InspectorControls>
Expand All @@ -157,8 +157,8 @@ registerBlockType( 'core/gallery', {

return (
<div className={ `blocks-gallery align${ align }` } >
{ images.map( ( img, i ) => (
<GalleryImage key={ i } img={ img } />
{ images.map( ( img ) => (
<GalleryImage key={ img.url } img={ img } />
) ) }
</div>
);
Expand Down

0 comments on commit 6b7bf26

Please sign in to comment.