This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-06-02
Channels
- # announcements (1)
- # asami (89)
- # aws (10)
- # babashka (41)
- # beginners (71)
- # calva (25)
- # cider (3)
- # clj-kondo (65)
- # cljdoc (15)
- # cljs-dev (3)
- # cljsrn (8)
- # clojure (56)
- # clojure-europe (44)
- # clojure-italy (1)
- # clojure-nl (2)
- # clojure-uk (48)
- # clojured (7)
- # clojurescript (17)
- # conjure (6)
- # cursive (3)
- # datomic (9)
- # emacs (11)
- # events (3)
- # fulcro (3)
- # helix (3)
- # honeysql (7)
- # hugsql (6)
- # introduce-yourself (2)
- # jobs (2)
- # kaocha (4)
- # luminus (1)
- # nrepl (2)
- # off-topic (10)
- # pathom (7)
- # philosophy (3)
- # polylith (27)
- # reagent (18)
- # reitit (3)
- # remote-jobs (7)
- # reveal (3)
- # shadow-cljs (9)
- # slack-help (5)
- # tools-deps (9)
- # vim (48)
hi! what this :f>
means in Reagent?
Welp... I need to have an actual hyphenated property but reagent converts it to camelcase. what to do?
What is the case where you need this? React needs camelCase for all element properties. data- and aria- properties are special case, and should be ignored by Reagent.
Or hmm... nowadays React just uses "unknown" properties as is: https://reactjs.org/blog/2017/09/08/dom-attributes-in-react-16.html
IIRC Reagent won't touch the key if you use string as key.
[:div {:on-click "this key will be converteted" :data-foo "data- property names aren't converted" "string-key-foo-bar" "this key is used as is"} ...]
Yeah reagent will convert just keyword and symbols to camelCase: https://github.com/reagent-project/reagent/blob/master/src/reagent/impl/template.cljs#L48-L55
https://reactjs.org/docs/dom-elements.html#all-supported-html-attributes React doesn't directly support that property, but should work as-is if you use string as properties map key.
[:g {"render-order" 5} ...]
Hmm, I wonder if render-order was ever implemented in browsers? That spec is just a draft, and searches don't return anything.
Yea it doesn't appear to be working very well haha
Hi all, is there a way to serialize hiccup with a custom component? Not sure how to get
[:div
[foo.bar/custom-component]]
to render from deserialization. Any tips?@aramz If all you are sending is the symbol, you need to walk the hiccup and replace the symbols with the references they should point to
Thank you @U3JH98J4R really appreciate the help
its a bit tedious, but if you keep a map at runtime of symbol name -> function (basically reifying the namespace) it shouldn't be too bad