com-lihaoyi / scalatags

ScalaTags is a small XML/HTML construction library for Scala.
https://com-lihaoyi.github.io/scalatags/
MIT License
758 stars 117 forks source link

Frag should override applyTo with a default value #148

Open lihaoyi opened 7 years ago

lihaoyi commented 7 years ago

Otherwise you have to do the following to inherit from Frag:

object View extends Frag{
  val view: Frag = ???
  def render = view.render
  def applyTo(t: dom.Element) = t.appendChild(render)
}

Not the end of the world, but more annoying than it should be. applyTo is always just going to append the rendered frag to the builder element