Closed kennyjwilli closed 8 years ago
Here is a hack to make it work:
(defmacro elem
[n & args]
(let [n (name n)
[opts children] (if (map? (first args))
[(first args) (rest args)]
[{} args])
type (first children)
s (symbol (str "cljs-react-material-ui.core/" n))]
`(let [component# (cond
~(nil? type) (~s ~opts)
~(vector? type) (let [c# (rum/defc ~(gensym (name n)) [] ~(last children))]
(~s ~opts (c#)))
~(seq? type) (~s ~opts ~@children))]
component#)))
(mui/elem :tabs
(mui/elem :tab {:label "One"} [:div "content1"])
(mui/elem :tab {:label "Two"} [:div "content2"]))
Thank you, I added Rum support, please see Readme
Mostly works in Rum.. Just one annoyance, you cannot pass hiccup to a mui component. It would be nice if you could. Example