From 164e9d06ed9d83d2354b05eb1ca143c6e67619de Mon Sep 17 00:00:00 2001 From: Jakob Krigovsky Date: Fri, 23 Jun 2017 11:32:26 +0200 Subject: [PATCH] Avoid Array.prototype.find() --- src/components/picker.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/picker.js b/src/components/picker.js index dc4214e..3eef099 100644 --- a/src/components/picker.js +++ b/src/components/picker.js @@ -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) }