add some utility components
This commit is contained in:
parent
bc47be1f94
commit
527fca4acb
16
src/webtools/reagent/components.cljs
Normal file
16
src/webtools/reagent/components.cljs
Normal file
|
@ -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})]))
|
Reference in a new issue