Skip to content

Commit 10f69ea

Browse files
committed
Fix to avoid React Special Props Warning
1 parent f34ae09 commit 10f69ea

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/components/Board/Board.component.js

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

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ const propTypes = {
2727
*/
2828
variant: PropTypes.oneOf(['button', 'folder', 'board']),
2929
/**
30-
* Unique key for the tile, used for React reconciliation
31-
* and should be unique among siblings.
30+
* Unique id for the tile key, used for React reconciliation.
31+
* Should be unique among siblings.
3232
*/
33-
key: PropTypes.string
33+
id: PropTypes.string
3434
};
3535

3636
const defaultProps = {};
@@ -42,6 +42,7 @@ const Tile = props => {
4242
children,
4343
className: classNameProp,
4444
variant,
45+
id,
4546
...other
4647
} = props;
4748

@@ -72,7 +73,7 @@ const Tile = props => {
7273

7374
return (
7475
<Scannable onSelect={onSelect} id={'scannable'}>
75-
<button className={className} type="button" {...other}>
76+
<button className={className} type="button" key={id} {...other}>
7677
<div className={tileShapeClassName} style={tileShapeStyles} />
7778
{children}
7879
</button>

0 commit comments

Comments
 (0)