Skip to content

Commit f34ae09

Browse files
Merge pull request #1872 from cboard-org/fix-wrong-render-of-images-on-change-fixed-board
Add unique key property to tile buttons for rendering consistency
2 parents 49c96cc + 8a22ba1 commit f34ae09

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/components/Board/Board.component.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,7 @@ export class Board extends Component {
261261
onFocus={() => {
262262
this.handleTileFocus(tile.id);
263263
}}
264+
key={tile.id}
264265
>
265266
<Symbol
266267
image={tile.image}

src/components/Board/Tile/Tile.component.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,12 @@ const propTypes = {
2525
/**
2626
* Type of tile
2727
*/
28-
variant: PropTypes.oneOf(['button', 'folder', 'board'])
28+
variant: PropTypes.oneOf(['button', 'folder', 'board']),
29+
/**
30+
* Unique key for the tile, used for React reconciliation
31+
* and should be unique among siblings.
32+
*/
33+
key: PropTypes.string
2934
};
3035

3136
const defaultProps = {};

0 commit comments

Comments
 (0)