      (identical? (type props) js/Object) props
      :else (let [objprops (js-obj)]
              (when-not is-empty
-               (doseq [[k v] props]
-                 (aset objprops (cached-prop-name k)
-                       (convert-prop-value v))))
+               (reduce-kv (fn [o k v]
+                            (doto o (aset (cached-prop-name k)
+                                          (convert-prop-value v))))
+                          objprops props))
              (when-not (nil? id-class)
                (set-id-class objprops id-class))
              objprops))))

(def cached-prop-name (memoize undash-prop-name))
(def cached-style-name (memoize dash-to-camel))

(defn convert-prop-value [val]
  (cond (map? val) (let [obj (js-obj)]
                     (doseq [[k v] val]
                       (aset obj (cached-style-name k) (clj->js v)))
                     obj)
        (ifn? val) (fn [& args] (apply val args))
        :else (clj->js val)))

(defn set-id-class [props [id class]]
  (aset props "id" id)

  (let [props (get-props this)
        on-change (or (props :on-change) (props "onChange"))]
    (when-not (nil? on-change)
      (let [target (.-target e)]
        (.setState this #js {:value (.-value target)
                             :checked (.-checked target)}))
      (on-change e))))

(defn input-will-receive-props [this new-props]
  (let [props (aget new-props cljs-props)]
