    (fn [f]
      (fn []
        (this-as this
-         (let [props (.. this -state -cljs$props)]
+         (let [props (get-in @component-state [this :props])]
            (update-subscriptions this props props)
            (when f
              (f this
                 props
-                (.. this -state -cljs$state)
-                (.. this -state -cljs$previousState)))))))
+                (get-in @component-state [this :state])
+                (get-in @component-state [this :prev-state])))))))
 
    "componentWillReceiveProps"
    (fn [f]
-     (fn [next-props]
-       (this-as this
-         (let [next-props (expand-props this (parse-props next-props))
-               prev-props (.. this -state -cljs$props)]
-           (doto (.-state this)
-             (gobj/set "cljs$previousProps" prev-props)
-             (gobj/set "cljs$props" next-props))
-           (binding [*trigger-state-render* false
-                     *use-prior-props* true]
-             (update-subscriptions this prev-props next-props)
-             (when f (f this prev-props next-props)))))))
+     (fn [props]
+       (let [next-props (.-cljs$props props)
+             next-children (.-cljs$children props)]
+         (this-as this
+           (let [next-props (expand-props this next-props)
+                 prev-props (get-in @component-state [this :props])]
+             (swap! component-state update this #(-> %
+                                                     (assoc :prev-props prev-props)
+                                                     (assoc :props next-props)
+                                                     (assoc :children next-children)))
+             (binding [*trigger-state-render* false
+                       *use-prior-props* true]
+               (update-subscriptions this prev-props next-props)
+               (when f (f this prev-props next-props))))))))
 
    "shouldComponentUpdate"
    (fn [f]

  "React complains if we mutate props, so we always read from state.
  (this is set in componentWillReceiveProps)"
  [this]
  (if (or *use-prior* *use-prior-props*)
    (.. this -state -cljs$previousProps)
    (.. this -state -cljs$props)))

(defn children [this]
  (:view$children (props this))
  #_(some-> this .-props .-children))

(defn parse-props [props]
  (.-cljs$props props))

(defn state [this]
  (if *use-prior*
    (some-> this .-state .-cljs$previousState)
    (some-> this .-state .-cljs$state)))

;; State manipulation


  ([this] (render-component this (props this)))
  ([this props] (render-component this props nil))
  ([this props & children]
    ;; manually invoke componentWillReceiveProps
   (when-let [will-receive-props (.-componentWillReceiveProps this)]
     (.call will-receive-props this #js {:cljs$props props
                                         :cljs$children children}))

    ;; only render if shouldComponentUpdate returns true (emulate ordinary React lifecycle)
   (when (.call (.-shouldComponentUpdate this) this props (state this))
     (force-update this))))

;; TODO - include render loop

