This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-08-29
Channels
- # admin-announcements (1)
- # announcements (3)
- # babashka (18)
- # beginners (35)
- # cider (4)
- # clj-kondo (52)
- # cljs-dev (2)
- # clojure (92)
- # clojure-spec (18)
- # clojurescript (17)
- # conjure (11)
- # core-async (1)
- # datomic (11)
- # emacs (5)
- # fulcro (11)
- # graalvm (10)
- # helix (21)
- # kaocha (6)
- # malli (1)
- # membrane (37)
- # off-topic (110)
- # re-frame (1)
- # reagent (12)
- # reitit (5)
- # rewrite-clj (1)
- # sci (1)
- # shadow-cljs (40)
- # vim (21)
- # vrac (17)
You should statt shadow-cljs to watch your app [shadow-cljs watch app]
This will start a nrepl
And in Emacs you could cider-connect-cljs
To the given port.
Hello! I’m having problems to understand what’s the actual transformation that a Reagent component does to the props when it passes them down to the actual React component. I have a JS object that I get from a third-party library, and I’m applying `js->clj` to it in order to make some transformations and later pass it to a Reagent component. For this transformations, I would prefer to deal with keywords instead of strings, but if I apply `js->clj` with `:keywordize-keys true`, the Reagent component later doesn’t behave the same way. I thought Reagent wouldn’t care if the keys are keywordized or not!
Apart from some other things, Reagent turns keys like :a-b
into "aB"
. Reagent's conversion is different from js->clj
.
This is the function that converts props: https://github.com/reagent-project/reagent/blob/d1ae601d8da2391eedfdf7df4e9842048f20ec45/src/reagent/impl/template.cljs#L118
that was useful, thanks - so it seems that in a scenario like the one I’m describing, it’s not a good practice to do a js->clj
transformation if that object is going to be eventually passed down to a Reagent component, and probably it’s better to deal with the js object directly using something like applied-science.js-interop
, right?
Yep, or https://google.github.io/closure-library/api/goog.object.html or https://github.com/mfikes/cljs-bean or https://github.com/binaryage/cljs-oops