<.td(r)).toTagMod ) ) ) And I want " /> <.td(r)).toTagMod ) ) ) And I want " /> <.td(r)).toTagMod ) ) ) And I want "/>

Is there a way of rendering a TagMod in a component

94 Views Asked by At

Say I have a table defined as follows:

val cols = Seq("One", "Two", "Three")

<.table(
  <.tbody(
    <.tr(
      rows.map(r => <.td(r)).toTagMod 
    )
  )
) 

And I want to wrap each row part in a component:

ScalaComponent.builder[Seq[String]]("Row")
  .render_P(r => rows.map(r => <.td(r)).toTagMod)
  .build

The code will not compile as render_P expects a VdomNode and not a TagMod. Is there of converting?

1

There are 1 best solutions below

0
user79074 On BEST ANSWER

I figured out that I need to use toVdomArray in this context instead of toTagMod