reagent

Alexandre EL-KHOURY 2023-09-27T15:58:48.136199Z

hi, noob question, I was wondering what is the proper way to use innerHTML ?

Alexandre EL-KHOURY 2023-09-27T16:02:01.979369Z

This is how I am using it : (aset element "innerHTML" (showListByOrder items header edit delete)) But it renders html code, I get something like that :

([:div.list-data {:id "list-data"}]
   (for [item items]
     [:div.list-item
      [:div.list-item-attr.operation.select
       [:input {:type "checkbox"}]]......
        ...........

p-himik 2023-09-27T16:55:45.852409Z

Don't use aset and aget for anything but JS arrays, as per their docstring. If you would like to make it work via React and not direct DOM manipulation, then you can use this:

[:div {:dangerouslySetInnerHTML {:__html html}}]
If you must use DOM manipulation for some reason, then use this:
(set! element -innerHTML html)

❤️ 1