Fork me on GitHub
#helix
<
2020-06-10
>
y.khmelevskii00:06:31

> one thing I like about what we use at work is we add the namespace to the generated class name @lilactown yes, you can do it use label option in Emotion, please check it https://github.com/khmelevskii/emotion-cljs#labels

lilactown00:06:30

nice yeah, our defcss just does this automatically for us

y.khmelevskii00:06:41

in dev mode? good idea!

y.khmelevskii00:06:58

@fabrao > Oh, if I can only use Button instead of antd/Button I can call Button as `MyButton` , right? Thank you I use something like this

// badge.styled.cljs
(defstyled <Badge> :div ;; antd/Badge in your case 
  {:display       :inline-flex
   :align-items   :center
   :border-radius 12})

// badge.core.cljs
(defnc <Badge>
  [{:keys [class-name
           size
           view
           children]}]
  {:default default-props
   :spec    ::spec/props}
  ($ styled/<Badge> {:class-name class-name
                     :size       size
                     :view view})
        children)

y.khmelevskii00:06:37

I think that I will add small example with helix to the repo

fabrao00:06:03

how is the behavior when helix refresh?

fabrao00:06:56

@y.khmelevskii clj-commons/cljss not refresh with helix

y.khmelevskii00:06:31

I don’t have any issues with reloading helix component

fabrao00:06:01

Do you have channel for emotion?

y.khmelevskii01:06:28

No, I will create it

fabrao00:06:33

(ns app.core
  (:require
   ["react-dom" :as rdom]
   [helix.dom :as d]
   [helix.core :as hx :refer [$]]
   ["antd/es/button" :default Button]
   [emotion.core :refer [defstyled]]
   [app.lib :refer [defnc]]))

(defstyled Div d/div
           {:color :red})

(defnc App []
       ($ Div "Fernando"))

(defn ^:export start
  []
  (rdom/render ($ App)
    (js/document.getElementById "app")))
What I´m doing wrong?
(defstyled Div d/div
----------------------^---------------------------------------------------------
Can't take value of macro helix.dom/div
--------------------------------------------------------------------------------
  11 |            {:color :red})

Lucy Wang01:06:56

d/div is a macro around the native :div element, so just use :div. Not that you'll lose some preprocessing by the macro though - namely these special handling https://github.com/lokeh/helix/blob/0.0.12/src/helix/impl/props.cljc#L156-L160

fabrao01:06:17

I solved with this

(defstyled Div "div"
           {:color :red})

(defnc App []
       ($ Div "Fernando"))

👍 8
y.khmelevskii01:06:06

also you can use keyword :div

fabrao01:06:33

I thougth helix don´t render hiccup