Skip to content

Latest commit

 

History

History
20 lines (15 loc) · 652 Bytes

work-in-progress.md

File metadata and controls

20 lines (15 loc) · 652 Bytes

Work in Progress

Variable tag names

I have slightly variable html tag content based on some config being passed into a reagent component. I want to output "adjacent" divs with an incrementing index value on the end of the class name.

[:div.row-data
        (for [heading column-headings]
          (let [heading-tag-with-class (str "div.column-heading.column-heading-" (count (:display-names heading)))]
            [(keyword heading-tag-with-class) {:key (:symbol heading)}

This solution works, is a better way?.

Dominic

[:div.column-heading
  {:class (str "column-heading-" (count (:display-names heading)))}]