 (defn display-child
   ([component]
      (cond
-      (not (nil? (.. component -props)))
+      (not (nil? (.-tagName component)))
       {
-       :tag (tag-name component)
-       :children (display-children (.. component -props -children))
+       :tag (.-tagName component)
+       :children (display-children (g-array/toArray (.. component -children)))
        }
       (fn? component) {:sub-component (component-name component)}
       (string? component) {:text component}


(defn with-attr [attr-name attr-value]
  (fn -with-attr-pred [component]
    (let [actual-value (aget (.. component -props) attr-name)]
      (if (= attr-value actual-value)
        true
        {:msg "Attribute value does not match"
         :expected attr-value :actual actual-value
         :attr attr-name :props (.. component -props)}
        )
      )
    )
  )

(defn after-event [event-attr event-arg component callback]
  ((or
    (aget (.. component -props) (name event-attr))
    (fn [_] (throw (js/Error. (str "No event handler for " event-attr))))
    )
   event-arg)
  (callback component)
  )

  )

(defn -instrument [sub-component cursor m]
  (dom/div #js {:data-huh-sub-component sub-component
                :data-huh-cursor (.stringify js/JSON cursor)
                :data-huh-m (.stringify js/JSON m)})
  )

(defn decode-sub-component [sub-component]
  {:sub-component (js/eval (str "("
                                (.getAttribute sub-component
                                               "data-huh-sub-component")
                                ")"))
   :cursor (.parse js/JSON (.getAttribute sub-component "data-huh-cursor"))
   :m (.parse js/JSON (.getAttribute sub-component "data-huh-m"))}
  )

(defn test-predicates
