Skip to content

Commit

Permalink
Support optional attrs in :>
Browse files Browse the repository at this point in the history
Fix #10
  • Loading branch information
SevereOverfl0w committed Feb 24, 2019
1 parent 3ae4f25 commit 6f3df03
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/hicada/compiler.clj
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,13 @@
[hicada.normalize :as norm]
[hicada.util :as util]))

(def default-handlers {:> (fn [_ klass attrs & children]
[klass attrs children])
(def default-handlers {:> (fn
([_ klass]
[klass {} nil])
([_ klass attrs & children]
(if (map? attrs)
[klass attrs children]
[klass {} (cons attrs children)])))
:* (fn [_ attrs & children]
(if (map? attrs)
['js/React.Fragment attrs children]
Expand Down

0 comments on commit 6f3df03

Please sign in to comment.