       (.appendChild (.-body js/document) root-node))))
 
 (defn- configure-root! [vroot vdom]
-  (let [root (ui/velem-insert (as-velem vdom) vroot nil)]
-    (set! (.-root vroot) root)
-    (set! (.-on-dispose vroot) (fn [] (r/dispose root)))))
+  (let [velem (as-velem vdom)]
+    (set! (.-children vroot) [velem])
+    (ui/velem-insert velem vroot nil)))
 
 (defn- do-unmount! [vroot]
-  (let [root (.-root vroot)]
-    (when-not (keyword-identical? :unmounted root)
-      (ui/velem-remove root)
-      (set! (.-root vroot) :unmounted))))
+  (assert (instance? DOMElement vroot) "Can only unmount from managed elements")
+  (doseq [child (.-children vroot)]
+    (ui/velem-remove child))
+  (set! (.-children vroot) nil)
+  ;; (let [root (.-root vroot)]
+  ;;   (when-not (keyword-identical? :unmounted root)
+  ;;     (ui/velem-remove root)
+  ;;     (set! (.-root vroot) :unmounted)))
+  )
 
 (defn mount! [mount-point vdom]
   "Makes the specified mount-point the root of a managed element tree, replacing

      (.push ch* (as-velem ch))))
  ch*)

(defn- dom-element [ns-uri tag tail]
  (let [[_ tag-name id class] (re-matches re-tag tag)
        attrs? (first tail)
        have-attrs (map? attrs?)
        attrs (if have-attrs attrs? {})
        attrs (cond-> attrs

                (and id (not (:id attrs)))
                (assoc :id id)
                
                class
                (update :class
                        (fn [cls]
                          (let [class (.replace class re-dot " ")]
                            (if cls (str class " " cls) class)))))

        children (if have-attrs (rest tail) tail)
        children* (append-children* #js [] children)]
    (DOMElement. ns-uri tag-name attrs children* nil nil nil)))

(defn- dom-node? [x]
  (and x (> (.-nodeType x) 0)))

          (create-or-find-root-node mount-point))]
    (if-let [vroot (get-element-state root-node)]
      (do
        ;; (assert (.-root vroot) "Can only remount at a previous mount point")
        (do-unmount! vroot)
        (configure-root! vroot vdom))
      (do
