fix: ensure unique keys for React list (#352)

fixes #327
release
Nolan Lawson 2019-07-03 08:00:02 -07:00 committed by GitHub
parent 956aaa91f3
commit 3576091fc0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -204,7 +204,11 @@ export default class Category extends React.Component {
<ul className="emoji-mart-category-list">
{emojis &&
emojis.map((emoji) => (
<li key={emoji.id || emoji}>
<li
key={
(emoji.short_names && emoji.short_names.join('_')) || emoji
}
>
{NimbleEmoji({ emoji: emoji, data: this.data, ...emojiProps })}
</li>
))}