The way to style and Om component is based on how React handles styling. It would be a horrible mess to duplicate common CSS rules all over the application so is there a way to define the styles in a function or similar?
(defn my-css [] {:border "1px solid #000"})
(defn my-component [state]
(dom/div #js {:className "the-class-name"
:style #js (my-css)}))
I've tried using defn
and def
but I can't find a way to avoid
Caused by: clojure.lang.ExceptionInfo: JavaScript literal must use map or vector notation