     (doseq [child-key to-remove]
       (js-delete child-states child-key))))
 
-(defn- replace-attrs! [node node-state old-attrs new-attrs]
-  (let [old-style (:style old-attrs)
+(defn- replace-attrs! [node node-state new-attrs]
+  (let [old-attrs (.-attrs node-state)
+        old-style (.-style node-state)
         new-style (:style new-attrs)]
     (dispose-attrs node-state)
-    (replace-attrs!* node node-state
-                     (dissoc old-attrs :style)
-                     (dissoc new-attrs :style)
-                     bind-attr!)
-    (replace-attrs!* node node-state
-                     old-style
-                     new-style
-                     bind-style-prop!)))
+    (set! (.-attrs node-state)
+          (replace-attrs!* node node-state
+                           old-attrs
+                           (dissoc new-attrs :style)
+                           bind-attr!))
+    (set! (.-style node-state)
+          (replace-attrs!* node node-state
+                           old-style
+                           new-style
+                           bind-style-prop!))))
 
 ;; From hiccup.compiler:
 (def ^{:doc "Regular expression that parses a CSS-style id and class from an element name."


        :default
        (bind-prop-attr! (get-attr-setter element attr-name)
                         element attr-name attr-value node-state))))

  (defn- dispose-child-state [node-state child-key]
    (when-let [child-states (.-child-states node-state)]
      (when-let [state (aget child-states child-key)]
        (set! (.-disposed state) true)
        (when-let [disposed-callback (.-disposed-callback state)]
          (disposed-callback))
        (js-delete child-states child-key)))))

(defn- unbind-attr!* [node-state prefix attr-name]
  (let [attr-key (str "-" prefix "." attr-name)]

            node (create-dom-node tag)
            attrs? (second virtual-dom)
            attrs (when (map? attrs?) attrs?)
            state (init-element-state! node elem-spec tag)
            children (if attrs (nnext virtual-dom) (next virtual-dom))]
        ;(doseq [[k v] attrs]
        ;  (bind-attr! node k v state))
        (bind-attrs! node attrs state)
        (when children
          (append-children! node children))
        ;(when-let [m (.-meta state)]
