From 0d39e10a71b4d30f2c7553e4dc9027d1ced640b9 Mon Sep 17 00:00:00 2001 From: Etienne Lemay Date: Wed, 30 Nov 2016 20:31:02 -0500 Subject: [PATCH] =?UTF-8?q?Don=E2=80=99t=20check=20for=20backgroundImageFn?= =?UTF-8?q?=20change=20in=20Category#shouldComponentUpdate=20If=20the=20Fn?= =?UTF-8?q?=20is=20an=20anonymous=20function,=20it=20would=20always=20re-r?= =?UTF-8?q?ender=20the=20categories=20even=20when=20no=20other=20props=20c?= =?UTF-8?q?hange.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/category.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/category.js b/src/components/category.js index b5b1761..b71d6e2 100644 --- a/src/components/category.js +++ b/src/components/category.js @@ -17,9 +17,9 @@ export default class Category extends React.Component { shouldComponentUpdate(nextProps, nextState) { var { name, perLine, hasStickyPosition, emojis, emojiProps } = this.props, - { skin, size, set, backgroundImageFn } = emojiProps, + { skin, size, set } = emojiProps, { perLine: nextPerLine, hasStickyPosition: nextHasStickyPosition, emojis: nextEmojis, emojiProps: nextEmojiProps } = nextProps, - { skin: nextSkin, size: nextSize, set: nextSet, backgroundImageFn: nextBackgroundImageFn } = nextEmojiProps, + { skin: nextSkin, size: nextSize, set: nextSet } = nextEmojiProps, shouldUpdate = false if (name == 'Recent' && perLine != nextPerLine) { @@ -30,7 +30,7 @@ export default class Category extends React.Component { shouldUpdate = !(emojis == nextEmojis) } - if (skin != nextSkin || size != nextSize || set != nextSet || hasStickyPosition != nextHasStickyPosition || backgroundImageFn != nextBackgroundImageFn) { + if (skin != nextSkin || size != nextSize || set != nextSet || hasStickyPosition != nextHasStickyPosition) { shouldUpdate = true }