{"action":"closed","issue":{"url":"https://api.github.com/repos/reactjs/redux/issues/1437","repository_url":"https://api.github.com/repos/reactjs/redux","labels_url":"https://api.github.com/repos/reactjs/redux/issues/1437/labels{/name}","comments_url":"https://api.github.com/repos/reactjs/redux/issues/1437/comments","events_url":"https://api.github.com/repos/reactjs/redux/issues/1437/events","html_url":"https://github.com/reactjs/redux/issues/1437","id":135775976,"number":1437,"title":"Reference Equality Check before setState()","user":{"login":"matianfu","id":376881,"avatar_url":"https://avatars.githubusercontent.com/u/376881?v=3","gravatar_id":"","url":"https://api.github.com/users/matianfu","html_url":"https://github.com/matianfu","followers_url":"https://api.github.com/users/matianfu/followers","following_url":"https://api.github.com/users/matianfu/following{/other_user}","gists_url":"https://api.github.com/users/matianfu/gists{/gist_id}","starred_url":"https://api.github.com/users/matianfu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matianfu/subscriptions","organizations_url":"https://api.github.com/users/matianfu/orgs","repos_url":"https://api.github.com/users/matianfu/repos","events_url":"https://api.github.com/users/matianfu/events{/privacy}","received_events_url":"https://api.github.com/users/matianfu/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/reactjs/redux/labels/question","name":"question","color":"cc317c"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-02-23T15:50:11Z","updated_at":"2016-02-23T16:00:42Z","closed_at":"2016-02-23T16:00:42Z","body":"Correct me if I'm wrong.\r\n\r\nI noticed in Connect component's handleChange() method, each time store state changes, the setState() method is triggered. So each time the store state changes, all mounted container component generated by Connect() will fire setState(), and in turn, shouldComponentUpdate() would be called, and as long as store state changes, render() will be called.\r\n\r\nI wonder if we can do a \"reference equality check\" before setState() is called. Would this eliminate many unnecessary calls to render() and improve performance?\r\n\r\nMy understanding is the setState() is designed for UI's local state, not the global state change irrelevent to this component. So that any state change will trigger all container component's method should be avoided."}}