{"action":"created","issue":{"url":"https://api.github.com/repos/reagent-project/reagent/issues/107","labels_url":"https://api.github.com/repos/reagent-project/reagent/issues/107/labels{/name}","comments_url":"https://api.github.com/repos/reagent-project/reagent/issues/107/comments","events_url":"https://api.github.com/repos/reagent-project/reagent/issues/107/events","html_url":"https://github.com/reagent-project/reagent/issues/107","id":59499212,"number":107,"title":":should-component-update isn't getting called.","user":{"login":"aerohit","id":240620,"avatar_url":"https://avatars.githubusercontent.com/u/240620?v=3","gravatar_id":"","url":"https://api.github.com/users/aerohit","html_url":"https://github.com/aerohit","followers_url":"https://api.github.com/users/aerohit/followers","following_url":"https://api.github.com/users/aerohit/following{/other_user}","gists_url":"https://api.github.com/users/aerohit/gists{/gist_id}","starred_url":"https://api.github.com/users/aerohit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aerohit/subscriptions","organizations_url":"https://api.github.com/users/aerohit/orgs","repos_url":"https://api.github.com/users/aerohit/repos","events_url":"https://api.github.com/users/aerohit/events{/privacy}","received_events_url":"https://api.github.com/users/aerohit/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-03-02T15:50:47Z","updated_at":"2015-03-03T16:00:06Z","closed_at":null,"body":"I have a component which I don't want to be re-rendered. So I have attached a function to :should-component-update which basically returns false all the times. But, the component gets re-rendered. To investigate the issue, I put in a print statement inside the attached function, but I never see the message. So I infer that it isn't getting called. The code is below, could you please point out if I am doing something wrong.\r\n\r\n\r\n``` clojure\r\n(defn summary-photo-component []\r\n  (with-meta\r\n    (fn [props]\r\n      (let [url (image-url 370 (:profileimage @state/accommodation))]\r\n        [:div.photo\r\n         {:style {:background-image (str \"url('\" url \"')\")}}\r\n         \"Foto van de accomodatie\"]))\r\n    {:should-component-update (fn [this old-argv new-argv] (do (prn \"Foo\") false))}))\r\n```\r\n\r\nThanks and regards,\r\nRohit"},"comment":{"url":"https://api.github.com/repos/reagent-project/reagent/issues/comments/76973369","html_url":"https://github.com/reagent-project/reagent/issues/107#issuecomment-76973369","issue_url":"https://api.github.com/repos/reagent-project/reagent/issues/107","id":76973369,"user":{"login":"marcloyal3","id":10565732,"avatar_url":"https://avatars.githubusercontent.com/u/10565732?v=3","gravatar_id":"","url":"https://api.github.com/users/marcloyal3","html_url":"https://github.com/marcloyal3","followers_url":"https://api.github.com/users/marcloyal3/followers","following_url":"https://api.github.com/users/marcloyal3/following{/other_user}","gists_url":"https://api.github.com/users/marcloyal3/gists{/gist_id}","starred_url":"https://api.github.com/users/marcloyal3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcloyal3/subscriptions","organizations_url":"https://api.github.com/users/marcloyal3/orgs","repos_url":"https://api.github.com/users/marcloyal3/repos","events_url":"https://api.github.com/users/marcloyal3/events{/privacy}","received_events_url":"https://api.github.com/users/marcloyal3/received_events","type":"User","site_admin":false},"created_at":"2015-03-03T16:00:06Z","updated_at":"2015-03-03T16:00:06Z","body":"@holmsand I had it working at some point using the with-meta approach but then being a noob I have no idea what I did because I can't get it to work again...  Anyway, when I set the return value of should-component-update to true I noticed extra updates were occurring but again I don't remember the exact behavior. Also, I don't believe that it was passing in the previous and current state correctly since the equality test for components whose state hasn't changed was resulting in false... I think it would certainly be a fundamentally good thing to give user control over when the component updates since cursors may be \"coarse\" (as in providing access to part of the atom that is shared by other instances of the component, when using a component factory pattern and passing in options that specialize each instance, e.g. instance of input component for first name vs instance of input component for last name) and so when the end user changes the first name the last name filed will also update... In such instances, and other scenarios I'm sure, it would be good to allow each instance to decide if it should update or not. My solution was to pass \"fine grained\" cursors (that provide access to only first name or last name etc not the whole form data structure) and that solved the problem of unnecessary updates but made configuring the component a more terse activity (passing in fine grained cursors)  "}}