Skip to content

Commit

Permalink
Don't use index for React element keys
Browse files Browse the repository at this point in the history
  • Loading branch information
ellatrix committed Oct 26, 2018
1 parent 35d017d commit 7fd020f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/editor/src/components/rich-text/format-edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class Shortcut extends Component {
const FormatEdit = ( { onChange, value } ) => {
return (
<Fragment>
{ getFormatTypes().map( ( { name, edit: Edit, keywords }, i ) => {
{ getFormatTypes().map( ( { name, edit: Edit, keywords } ) => {
if ( ! Edit ) {
return null;
}
Expand All @@ -80,7 +80,7 @@ const FormatEdit = ( { onChange, value } ) => {

return (
<Edit
key={ i }
key={ name }
isActive={ isActive }
activeAttributes={ activeAttributes }
value={ value }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ const FormatToolbar = ( { controls } ) => {
return (
<div className="editor-format-toolbar">
<Toolbar>
{ controls.map( ( format, index ) =>
<Slot name={ `RichText.ToolbarControls.${ format }` } key={ index } />
{ controls.map( ( format ) =>
<Slot name={ `RichText.ToolbarControls.${ format }` } key={ format } />
) }
</Toolbar>
</div>
Expand Down

0 comments on commit 7fd020f

Please sign in to comment.