This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-02-04
Channels
- # announcements (7)
- # babashka (26)
- # babashka-sci-dev (19)
- # beginners (66)
- # calva (4)
- # clj-kondo (55)
- # cljs-dev (173)
- # cljsrn (17)
- # clojure (86)
- # clojure-art (3)
- # clojure-australia (1)
- # clojure-europe (24)
- # clojure-india (1)
- # clojure-nl (3)
- # clojure-uk (6)
- # clojured (5)
- # clojurescript (39)
- # cursive (8)
- # data-oriented-programming (20)
- # datomic (9)
- # emacs (10)
- # events (1)
- # figwheel-main (16)
- # fulcro (33)
- # gratitude (1)
- # helix (2)
- # hugsql (2)
- # jobs (2)
- # kaocha (4)
- # leiningen (5)
- # lsp (110)
- # malli (1)
- # missionary (17)
- # observability (3)
- # re-frame (10)
- # reagent (1)
- # reitit (7)
- # rewrite-clj (3)
- # shadow-cljs (63)
- # sql (19)
- # tools-build (74)
- # tools-deps (32)
- # transit (1)
- # xtdb (5)
Hi, does anyone know if there's a way to use custom / non-standard DOM attributes using Reagent? In my case, I was hoping to attach some styling using a CSS attribute selector, but the only custom attributes that Reagent seems to let through are data-* ones.
React's supposed to support them as of version 16: https://reactjs.org/blog/2017/09/08/dom-attributes-in-react-16.html
What I'm trying is something like this:
[:div {:class "my-class" :my-attr true} ... ]
And hoping to get this rendered bit of DOM:
<div class="my-class" my-attr=true>..</div>
So I can do this in CSS:
div.my-class[my-attr] {
/* insert style here */
}
It works if I use :data-my-attr
as the attribute name, but otherwise unrecognized attributes are being ignored.