   [methods]
   (->> (collect [{:view/will-receive-props (fn [this props]
                                              ;; when a component receives new props, update internal state.
-                                             (let [next-props (aget props "props")]
-                                               (vswap! (gobj/get this "re$view") assoc
-                                                       :view/props next-props
-                                                       :view/children (aget props "children"))))
+                                             (let [{prev-props :view/props prev-children :view/children :as this} this]
+                                               (let [next-props (aget props "props")]
+                                                 (vswap! (gobj/get this "re$view")
+                                                         assoc
+                                                         :view/props next-props
+                                                         :view/prev-props prev-props
+                                                         :view/children (aget props "children")
+                                                         :view/prev-children prev-children))))
                   :view/should-update      (fn [{:keys [view/props
                                                         view/prev-props
                                                         view/children

                                       (when-let [un-sub (aget this "reactiveUnsubscribe")]
                                         (un-sub))
                                       (some-> state (remove-watch this)))
                  :view/did-update   (fn [this]
                                       ;; after update, update prev-props and prev-state
                                       (finish-lifecycle this))}])
       (reduce-kv (fn [obj method-k method]
                    (doto obj
                      (gobj/set (get kmap method-k) (wrap-methods method-k method)))) #js {})))



(defn swap-silently!
  "Swap a component's state atom without forcing an update (render)"

                                                 (d/listen patterns #(force-update this))))
          (vswap! re$view assoc :view/re-db.patterns patterns))
        value))))

(def ^:private kmap
  "Mapping of methods-map keys to React lifecycle keys."
