From 69384d98c616482a7d142251c7a54bbf2372e06d Mon Sep 17 00:00:00 2001 From: Dan Holmsand Date: Sat, 8 Feb 2014 10:55:29 +0100 Subject: [PATCH] Simplify create-class --- src/reagent/impl/component.cljs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/reagent/impl/component.cljs b/src/reagent/impl/component.cljs index 0b15bab..1493cd4 100644 --- a/src/reagent/impl/component.cljs +++ b/src/reagent/impl/component.cljs @@ -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))