{"action":"opened","issue":{"url":"https://api.github.com/repos/omcljs/om/issues/502","labels_url":"https://api.github.com/repos/omcljs/om/issues/502/labels{/name}","comments_url":"https://api.github.com/repos/omcljs/om/issues/502/comments","events_url":"https://api.github.com/repos/omcljs/om/issues/502/events","html_url":"https://github.com/omcljs/om/issues/502","id":119239815,"number":502,"title":"componentWillReceiveProps gets stale `next-props` after `transact!`","user":{"login":"anmonteiro","id":661909,"avatar_url":"https://avatars.githubusercontent.com/u/661909?v=3","gravatar_id":"","url":"https://api.github.com/users/anmonteiro","html_url":"https://github.com/anmonteiro","followers_url":"https://api.github.com/users/anmonteiro/followers","following_url":"https://api.github.com/users/anmonteiro/following{/other_user}","gists_url":"https://api.github.com/users/anmonteiro/gists{/gist_id}","starred_url":"https://api.github.com/users/anmonteiro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anmonteiro/subscriptions","organizations_url":"https://api.github.com/users/anmonteiro/orgs","repos_url":"https://api.github.com/users/anmonteiro/repos","events_url":"https://api.github.com/users/anmonteiro/events{/privacy}","received_events_url":"https://api.github.com/users/anmonteiro/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-11-27T19:41:52Z","updated_at":"2015-11-27T19:41:52Z","closed_at":null,"body":"Minimal case below (watch the console prints). The transaction renders (as expected) but `componentWillReceiveProps` doesn't get the new props as a parameter.\r\n\r\n```clojure\r\n(def data {:foo \"initial value\"})\r\n\r\n(defn read\r\n  [{:keys [state]} k _]\r\n    {:value (get @state k)})\r\n\r\n(defmulti mutate om/dispatch)\r\n(defmethod mutate `change-foo\r\n  [{:keys [state] :as env} _ {:keys [value]}]\r\n  {:value {:keys [:foo]}\r\n   :action #(swap! state assoc :foo value)})\r\n\r\n(defui Root\r\n  static om/IQuery\r\n  (query [this] [:foo])\r\n  Object\r\n  (componentWillReceiveProps [this {:keys [foo] :as next-props}]\r\n    (js/console.log \"willReceiveProps: \" (pr-str next-props)\r\n                    \"Current props: \" (pr-str (om/props this))))\r\n  (render [this]\r\n    (dom/div nil\r\n      (dom/button #js {:onClick #(om/transact! this `[(change-foo {:value ~(system-time)})])}\r\n        \"transact\")\r\n      (dom/div nil (str \":foo => \" (:foo (om/props this)))))))\r\n\r\n(def reconciler\r\n  (om/reconciler\r\n   {:state  data\r\n    :parser (om/parser {:read read :mutate mutate})}))\r\n\r\n(om/add-root! reconciler Root (gdom/getElement \"app\"))\r\n```"}}