This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-07-26
Channels
- # aleph (1)
- # beginners (96)
- # boot (5)
- # cider (44)
- # cljdoc (11)
- # clojure (73)
- # clojure-conj (4)
- # clojure-dev (1)
- # clojure-finland (2)
- # clojure-italy (7)
- # clojure-new-zealand (1)
- # clojure-nl (3)
- # clojure-spec (4)
- # clojure-uk (66)
- # clojurescript (114)
- # code-reviews (16)
- # cursive (15)
- # datomic (37)
- # emacs (6)
- # events (2)
- # figwheel-main (12)
- # fulcro (36)
- # graphql (19)
- # hoplon (2)
- # hyperfiddle (3)
- # jobs (2)
- # leiningen (4)
- # off-topic (36)
- # om (1)
- # om-next (2)
- # other-languages (1)
- # re-frame (12)
- # reagent (12)
- # reitit (5)
- # remote-jobs (4)
- # ring (2)
- # shadow-cljs (218)
- # spacemacs (8)
- # specter (7)
- # sql (34)
- # tools-deps (9)
- # uncomplicate (6)
Hello. I'm trying to use react-sortable-hoc
(https://github.com/clauderic/react-sortable-hoc) in Reagent.
I started just like here: https://gist.github.com/vbedegi/0329db5ff5772526a34b56d59e07d320
The problem is that my components pass CLJS maps in props
. So, if my Reagent component receives something like {:a {:b 1}}
, its version wrapped like in the gist receives {:a # js {:b 1}}
.
It looks like reagent/reactify-component
+ reagent/adapt-react-class
do js<->cljs transformation only on one level of props.
To clarify - I mentioned react-sortable-hoc
only to justify the whole (-> my-component reagent/reactify-component transform reagent/adapt-react-class)
pipeline.
If I use identity
in place of transform
, the issue persists.
Hmm, the top-level cljs map is probably created here: reagent.impl.component/shallow-obj-to-map
.
@p-himik I’m not sure what the motivation for the shallow conversion is, but note that you can just run`clj->js` on #js
structures or mixed structures again
so you could either wrap the incoming props in the implementation or you could create a helper function
it’s a bit annoying that you’d double convert the top-level props, but I’d be shocked if that ever really matters