|
|
@@ -60,11 +60,17 @@
|
|
|
[(first args) (rest args)]
|
|
|
[{} args])
|
|
|
type# (first children)
|
|
|
+ children# (daiquiri.interpreter/interpret children)
|
|
|
+ children# (if (= 1 (count children#)) (first children#) children#)
|
|
|
;; we have to make sure to check if the children is sequential
|
|
|
;; as a list can be returned, eg: from a (for)
|
|
|
- new-children (if (sequential? type#)
|
|
|
- [(daiquiri.interpreter/interpret children)]
|
|
|
- (daiquiri.interpreter/interpret children))
|
|
|
+ new-children (if (and (not (nil? children#))
|
|
|
+ (not (empty? children))
|
|
|
+ (or (not (array? children#))
|
|
|
+ ;; maybe list children
|
|
|
+ (not (vector? type#))))
|
|
|
+ [children#] children#)
|
|
|
+
|
|
|
;; convert any options key value to a React element, if
|
|
|
;; a valid html element tag is used, using sablono (rum.daiquiri)
|
|
|
vector->react-elems (fn [[key val]]
|