This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-09-19
Channels
- # announcements (5)
- # asami (7)
- # aws (10)
- # babashka (10)
- # beginners (49)
- # calva (12)
- # cider (5)
- # circleci (1)
- # clj-kondo (25)
- # clj-yaml (14)
- # clojars (5)
- # clojure (134)
- # clojure-europe (142)
- # clojure-france (3)
- # clojure-nl (1)
- # clojure-norway (4)
- # clojurescript (10)
- # cursive (8)
- # datomic (19)
- # emacs (11)
- # fulcro (8)
- # graalvm (29)
- # honeysql (7)
- # jobs (4)
- # jobs-discuss (9)
- # lsp (196)
- # obb (4)
- # off-topic (40)
- # pathom (4)
- # releases (4)
- # remote-jobs (3)
- # shadow-cljs (16)
- # sql (25)
- # squint (2)
- # tools-deps (12)
- # xtdb (7)
- # yada (4)
Is there some way in fulcro to render dom dynamically? Let's say I have vector of components (that's created dynamically) [(dom/h1 "hello") (dom/h2 "hello2")]. Is there a way to put those dom elements easily into existing dom? I know that I can use element "innerHTML" and just put the html there, but I was wondering if there is more react/fulcro way
you can just create a new root if you like, fulcro has floating roots that you might be interested in https://book.fulcrologic.com/#_using_fulcro_component_classes_in_vanilla_js_detached_subtrees
Yeah, to put it in real case scenario, it's that user writes markdown and I want to instantly display it for him with more readable visuals (so I translate it to html with css). It happens on the go. When user adds input, I need to add more html. Thanks, I will look into this!
Ah for such cases usually https://reactjs.org/docs/dom-elements.html#dangerouslysetinnerhtml is used.
Yeah that's what I used, with DOMPurify to make sure it's safe. But I was wondering if there is better way 😄