Not sure if its exactly reagent specific, but how do I output html I am receiving from a db as a string.. so far all my attempts have dutifully escaped it, but in this case I donβt want it escaped (its not user input so not worried about sanitizing it)
In case anyone else runs into this problem: [:div {:dangerouslySetInnerHTML {:_html VAR-WITH-HTML_}}]
Hey guys. I have this:
[breadcrumbs
[:a {:href "/"} "Home"]
[:a {:href "/dashboard"} "Dashboard"]
How do I make it work programatically (having a fn returning list of these breadcrumbs)?
The minute I introduce :<>, the individual breadcrumbs are no longer direct children of breadcrumbs, so they render without the formatting this component provides.
Essentially I want something like:
[breadcrumbs (build-breadcrumbs current-route)]
But no matter what I try, it's just not producing the desired structure with :a being a direct children of breadcrumbs. (Essentially I want an analog to ~@ in macro expansion.)
Is there a way to do it in hiccup?Probably completely irrelevant, but breadcrumbs comes from https://mui.com/joy-ui/api/breadcrumbs/
(into [breadcrumbs] ...)
Or a for loop as the only child, but only if you can provide a unique ^{:key ...} for each anchor vector.
I found another way FYI:
[breadcrumbs {:children [
(r/as-element [:a {} "Test"])
(r/as-element [:a {} "abc"])
(r/as-element [:a {} "xyz"])]}]