Avoid Array.prototype.find()
parent
435250f319
commit
164e9d06ed
|
@ -152,7 +152,8 @@ export default class Picker extends React.Component {
|
|||
|
||||
handleEmojiOver(emoji) {
|
||||
var { preview } = this.refs
|
||||
const emojiData = CUSTOM_CATEGORY.emojis.find(customEmoji => customEmoji.id === emoji.id)
|
||||
// Use Array.prototype.find() when it is more widely supported.
|
||||
const emojiData = CUSTOM_CATEGORY.emojis.filter(customEmoji => customEmoji.id === emoji.id)[0]
|
||||
preview.setState({ emoji: Object.assign(emoji, emojiData) })
|
||||
clearTimeout(this.leaveTimeout)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue