 
           (string? mount-point)
           (create-or-find-root-node mount-point))]
-    (if-let [vroot (.-freactive-root root-node)]
+    (if-let [vroot (get-element-state root-node)]
       (do
-        (remove! (.-root vroot))
-        (configure-root! vroot root-node vdom))
+        (assert (.-root vroot) "Can only remount at a previous mount point")
+        (r/dispose vroot)
+        (configure-root! vroot vdom))
       (do
-        (ensure-unmanaged root-node)
         (loop []
           (let [last-child (.-lastChild root-node)]
             (when last-child
-              (remove! last-child)
+              (ui/velem-remove (as-velem (get-velem-state last-child)))
               (recur))))
-        (let [vroot (RootElement. nil)]
-          (set! (.-freactive-root root-node) vroot)
-          (configure-root! vroot root-node vdom))))
-    root)) 
+        (let [vroot (wrap-unmanaged-node root-node nil)]
+          (configure-root! vroot vdom))))
+    root-node)) 
+
+(defn unmount! [mount-point]
+  (let [root-node
+        (cond
+          (dom-node? mount-point)
+          mount-point
+
+          (string? mount-point)
+          (find-by-id mount-point))
+        vroot (get-element-state root-node)]
+    (assert (and root-node vroot (.-root vroot)) "Can't find mount point")
+    (r/dispose vroot)
+    root-node))

    (ui/velem-remove old-velem)
    (dom-insert (ui/native-parent parent) new-node next-sib)))

(deftype UnmanagedDOMNode [node ^:mutable parent]
  ui/IVirtualElement
  (-velem-parent [this] parent)
  (-velem-head [this] this)

    (assert (instance? DOMElement velem) "Not a managed DOM element.")
    velem))

(defn set-attrs!
  "Sets the attributes on a managed element to the new-attrs map
(unsetting previous values if not present in the new map)."
