Skip to content

Commit

Permalink
Fix "React keys must be passed directly to JSX without spread"
Browse files Browse the repository at this point in the history
  • Loading branch information
manzoorwanijk committed Jun 25, 2024
1 parent f99b321 commit 708c4ad
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion apps/notifications/src/panel/templates/note-list.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ export class NoteList extends Component {
let [ notes ] = Object.entries( noteGroups ).reduce(
( [ list, isFirst ], [ timeGroupKey, timeGroupNotes ] ) => {
const title = groupTitles[ timeGroupKey ];
const header = <ListHeader { ...{ key: title, title, isFirst } } />;
const header = <ListHeader key={ title } title={ title } isFirst={ isFirst } />;

return [ [ ...list, header, ...timeGroupNotes.map( createNoteComponent ) ], false ];
},
Expand Down
2 changes: 1 addition & 1 deletion client/blocks/post-share/connections-list.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ class ConnectionsList extends PureComponent {
<div className="post-share__connections">
{ connections.map( ( connection ) => (
<Connection
key={ connection.keyring_connection_ID }
{ ...{
connection,
onToggle,
isActive: connection.isActive,
key: connection.keyring_connection_ID,
} }
/>
) ) }
Expand Down
2 changes: 1 addition & 1 deletion client/blocks/sharing-preview-pane/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ class SharingPreviewPane extends PureComponent {
</div>
<VerticalMenu onClick={ this.selectPreview } initialItemIndex={ initialMenuItemIndex }>
{ services.map( ( service ) => (
<SocialItem { ...{ key: service, service } } />
<SocialItem key={ service } service={ service } />
) ) }
</VerticalMenu>
</div>
Expand Down
2 changes: 1 addition & 1 deletion client/components/seo-preview-pane/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ export class SeoPreviewPane extends PureComponent {
</div>
<VerticalMenu onClick={ this.selectPreview }>
{ services.map( ( service ) => (
<SocialItem { ...{ key: service, service } } />
<SocialItem key={ service } service={ service } />
) ) }
</VerticalMenu>
</div>
Expand Down

0 comments on commit 708c4ad

Please sign in to comment.