Fork me on GitHub
#fulcro
<
2022-09-19
>
tony.kay01:09:58

You are correct. That indeed does seem to be a bug.

Mateusz Mazurczak08:09:09

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

bbss03:09:34

use react fragment? Not sure I understand your problem.

bbss03:09:25

oh, into existing dom, that is not managed by react yet?

bbss03:09:13

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

Mateusz Mazurczak07:09:10

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!

Mateusz Mazurczak11:09:48

Yeah that's what I used, with DOMPurify to make sure it's safe. But I was wondering if there is better way 😄