reagent

Ryan 2023-03-31T00:49:05.344539Z

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)

Ryan 2023-03-31T01:02:32.576829Z

In case anyone else runs into this problem: [:div {:dangerouslySetInnerHTML {:_html VAR-WITH-HTML_}}]

2023-03-31T13:35:19.587589Z

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?

2023-03-31T13:37:01.061949Z

Probably completely irrelevant, but breadcrumbs comes from https://mui.com/joy-ui/api/breadcrumbs/

p-himik 2023-03-31T13:38:28.755139Z

(into [breadcrumbs] ...)

πŸ‘ 1
p-himik 2023-03-31T13:39:08.690269Z

Or a for loop as the only child, but only if you can provide a unique ^{:key ...} for each anchor vector.

2023-03-31T13:42:27.046199Z

Thanks @p-himik

πŸ‘ 1
2023-03-31T13:42:57.552409Z

I found another way FYI:

[breadcrumbs {:children [
  (r/as-element [:a {} "Test"])
  (r/as-element [:a {} "abc"])
  (r/as-element [:a {} "xyz"])]}]