   (let [state (UnmanagedDOMNode. dom-node on-dispose nil)]
     (set! (.-freactive-state dom-node) state)
     state))
+
+(declare dom-element)
 
 (defn- as-velem [elem-spec]
   (cond

                              (if cls (str class " " cls) class)))))

          children (if have-attrs (rest tail) tail)
          children* (append-children* #js [] children)]
      (elem-factory ns-uri tag-name attrs children*))))

(def dom-element
  (element*
   (fn [ns-uri tag-name attrs children*]
     (DOMElement. ns-uri tag-name attrs children* nil nil nil))))

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

    (as-velem (r/-as-velem elem-spec as-velem))

    :default (as-velem (-get-dom-image elem-spec))))

(def dom-element
  (element*
   (fn [ns-uri tag-name attrs children*]
     (DOMElement. ns-uri tag-name attrs children* nil nil nil))
   (append-children* as-velem)))


;; Public API

