Simplify create-class

This commit is contained in:
Dan Holmsand 2014-02-08 10:55:29 +01:00
parent e8b108ea5e
commit 69384d98c6
1 changed files with 1 additions and 6 deletions

View File

@ -222,12 +222,7 @@
(let [spec (cljsify body)
res (.createClass React spec)
f (fn [& args]
(let [props (nth args 0 nil)
hasmap (map? props)
first-child (if (or hasmap (nil? props)) 1 0)]
(res (js-obj cljs-props (if hasmap props)
cljs-children (if (> (count args) first-child)
(subvec args first-child))))))]
(tmpl/as-component (apply vector res args)))]
(set! (.-cljsReactClass f) res)
(set! (.-cljsReactClass res) res)
f))