Merge pull request #16667 from desktop/fix-shortcut-key-warning

Fix React warning about missing `key` for `KeyboardShortcut` children
This commit is contained in:
Sergio Padrino 2023-05-10 09:50:13 +02:00 committed by GitHub
commit 44429be2eb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -13,10 +13,10 @@ export class KeyboardShortcut extends React.Component<IKeyboardShortCutProps> {
return keys.map((k, i) => {
return (
<>
<kbd key={k + i}>{k}</kbd>
<React.Fragment key={k + i}>
<kbd>{k}</kbd>
{!__DARWIN__ && i < keys.length - 1 ? <>+</> : null}
</>
</React.Fragment>
)
})
}