diff --git a/src/reagent/impl/component.cljs b/src/reagent/impl/component.cljs index 061c522..889cdbb 100644 --- a/src/reagent/impl/component.cljs +++ b/src/reagent/impl/component.cljs @@ -35,7 +35,8 @@ (if (map? p) p))) (defn extract-children [v] - (let [first-child (if (-> v (get 1) map?) 2 1)] + (let [p (get v 1) + first-child (if (or (nil? p) (map? p)) 2 1)] (if (> (count v) first-child) (subvec v first-child)))) diff --git a/src/reagent/impl/template.cljs b/src/reagent/impl/template.cljs index e17ece3..ae4f388 100644 --- a/src/reagent/impl/template.cljs +++ b/src/reagent/impl/template.cljs @@ -123,14 +123,14 @@ (defn wrapped-render [this comp id-class] (let [inprops (aget this "props") argv (aget inprops cljs-argv) - level (aget inprops cljs-level) props (get argv 1) hasprops (or (nil? props) (map? props)) first-child (if hasprops 2 1) - jsargs (if (> (count argv) first-child) - (map-into-array as-component (inc level) - (subvec argv first-child)) - (array)) + children (if (> (count argv) first-child) + (subvec argv first-child)) + jsargs (map-into-array as-component + (inc (aget inprops cljs-level)) + children) jsprops (convert-props (if hasprops props) id-class)] (when (input-components comp) (input-render-setup this jsprops))