From 5e788ebb49305871287c4bddabf1b13f7a83bd6c Mon Sep 17 00:00:00 2001 From: artpi Date: Thu, 26 Nov 2015 11:54:44 +0100 Subject: [PATCH] Remove shouldComponentUpdate from SiteStatsStickyLink Because shouldComponentUpdate was bound to url, onClick and title, the whole children subtree was not changed even if props changed there This was premature optimization Fixes #473 --- client/components/site-stats-sticky-link/index.jsx | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/client/components/site-stats-sticky-link/index.jsx b/client/components/site-stats-sticky-link/index.jsx index 14bc1f458c1b09..e16284dba49135 100644 --- a/client/components/site-stats-sticky-link/index.jsx +++ b/client/components/site-stats-sticky-link/index.jsx @@ -26,18 +26,6 @@ var SiteStatsStickyLink = React.createClass( { siteStatsStickyTabStore.off( 'change', this.handleStatsStickyTabChange ); }, - shouldComponentUpdate: function( nextProps, nextState ) { - if ( - nextState.url !== this.state.url || - nextProps.onClick !== this.props.onClick || - nextProps.title !== this.props.title - ) { - return true; - } - - return false; - }, - handleStatsStickyTabChange: function() { var url = siteStatsStickyTabStore.getUrl();