         (coll? x) (clj->js x)
         (ifn? x) (fn [& args]
                    (apply x args))
-        true (clj->js x)))
-
-(defn set-id-class [props id class]
-  (let [p (if (nil? props) #js{} props)]
-    (when (and (some? id)
-               (nil? (.' p :id)))
-      (.! p :id id))
-    (when (some? class)
-      (let [old (.' p :className)]
-        (.! p :className (if (some? old)
-                           (str class " " old)
-                           class))))
-    p))
+        :else (clj->js x)))
+
+(defn oset [o k v]
+  (doto (if (nil? o) #js{} o)
+    (aset k v)))
+
+(defn oget [o k]
+  (if (nil? o) nil (aget o k)))
+
+(defn set-id-class [p id-class]
+  (let [id (.' id-class :id)
+        p (if (and (some? id)
+                   (nil? (oget p "id")))
+            (oset p "id" id)
+            p)]
+    (if-some [class (.' id-class :className)]
+      (let [old (oget p "className")]
+        (oset p "className" (if (nil? old)
+                              class
+                              (str class " " old))))
+      p)))
 
 (defn convert-props [props id-class]
-  (let [id (.' id-class :id)
-        class (.' id-class :className)
-        no-id-class (and (nil? id) (nil? class))]
-    (if (and no-id-class (empty? props))
-      nil
-      (let [objprops (convert-prop-value props)]
-        (if no-id-class
-          objprops
-          (set-id-class objprops id class))))))
+  (-> props
+      convert-prop-value
+      (set-id-class id-class)))
 
 
 ;;; Specialization for input components

    0 (.' util/react createElement comp jsprops)

    1 (.' util/react createElement comp jsprops
          (as-element (nth argv first-child)))

    (.apply (.' util/react :createElement) nil
            (reduce-kv (fn [a k v]

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

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

