Skip to content

Commit

Permalink
Avoid Array.prototype.find()
Browse files Browse the repository at this point in the history
  • Loading branch information
sonicdoe committed Jun 23, 2017
1 parent 435250f commit 164e9d0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/picker.js
Expand Up @@ -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)
}
Expand Down

0 comments on commit 164e9d0

Please sign in to comment.