                             #js{} x)
         :else (to-js-val x)))
 
-(defn set-id-class [props [id class]]
-  (when (some? id)
+(defn set-id-class [props id-class]
+  (when-some [id (.' id-class :idName)]
     (let [pid (.' props :id)]
       (.! props :id (if (some? pid) pid id))))
-  (when (some? class)
+  (when-some [class (.' id-class :className)]
     (let [old (.' props :className)]
       (.! props :className (if (some? old)
                              (str class " " old)
                              class)))))
 
 (defn convert-props [props id-class]
-  (if (and (empty? props) (nil? id-class))
+  (if (and (empty? props) (not (.' id-class :hasIdClass)))
     nil
     (let [objprops
           (reduce-kv (fn [o k v]
-                       (let [pname (cached-prop-name k)]
-                         (aset o pname (convert-prop-value v)))
-                       o)
+                       (doto o
+                         (aset (cached-prop-name k)
+                               (convert-prop-value v))))
                      #js{} props)]
-      (when (some? id-class)
+      (when (.' id-class :hasIdClass)
         (set-id-class objprops id-class))
       objprops)))
 


;;; Props conversion

(def cached-prop-name (util/memoize-1 undash-prop-name))

(defn convert-prop-value [x]
  (cond (string? x) x

      (some->> key (.! jsprops :key)))
    (.' js/React createElement c jsprops)))


(def tag-name-cache #js{})

(defn cached-parse [x]
  (if-let [s (obj-get tag-name-cache (name x))]
    s
    (aset tag-name-cache (name x) (parse-tag x))))


(declare as-element)

(defn native-element [tag argv]
  (when (hiccup-tag? tag)
    (let [parsed (cached-parse tag)
          comp (.' parsed :name)]
      (let [props (nth argv 1 nil)
            hasprops (or (nil? props) (map? props))
            jsprops (convert-props (if hasprops props) parsed)
            first-child (if hasprops 2 1)]
        (if (input-component? comp)
          (-> [reagent-input argv comp jsprops first-child]
