             (when last-child
               (ui/velem-remove (as-velem (get-velem-state last-child)))
               (recur))))
-        (let [vroot (wrap-unmanaged-node root-node nil)]
+        (let [vroot (DOMElement.
+                     (.-namespaceURI root-node)
+                     (.-tagName root-node)
+                     {}
+                     nil ;; TODO parent
+                     root-node
+                     nil
+                     (bind-attrs! root-node {}))]
           (configure-root! vroot vdom))))
     root-node)) 
 

      (.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)))

          (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")
    (do-unmount! vroot)
    root-node))
