diff --git a/src/webtools/reagent/components.cljs b/src/webtools/reagent/components.cljs new file mode 100644 index 0000000..7704e50 --- /dev/null +++ b/src/webtools/reagent/components.cljs @@ -0,0 +1,16 @@ +(ns webtools.reagent.components) + +(defn ->keyed-comps + [components] + (map-indexed + (fn [idx comp] + (if (vector? comp) + (with-meta comp {:key idx}) + comp)) + components)) + +(defn raw-html + ([comp html-content] + (raw-html comp nil html-content)) + ([comp props html-content] + [comp (assoc props :dangerouslySetInnerHTML {:__html html-content})]))