question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Custom tags (ie: SVG)

See original GitHub issue

Hello, is it possible to extend the list of supported tags and attributes ?

value svg is not a member of object com.thoughtworks.binding.dom.Runtime.TagsAndTags2

[error]   @dom def render = <svg></svg>

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:14

github_iconTop GitHub Comments

3reactions
jfilalicommented, Jan 19, 2017

https://scalafiddle.io/sf/LpgeaSq/2 @Atry code to do custom code :

import com.thoughtworks.binding._, Binding._
import org.scalajs.dom.document
import org.scalajs.dom.raw.Node

case class MyComponentBuilder() {
  
  def render = this
    
  var foo: Binding[String] = _

  @dom def build = <button>{foo.bind}</button>
  
}

implicit def autoBinding[A](a: A): Binding[A] = ???

implicit final class CustomTags(x: dom.Runtime.TagsAndTags2.type) {
  
  def MyComponent() = MyComponentBuilder()
  
}

implicit def toHtml(x: MyComponentBuilder): BindingSeq[Node] = {
  Constants(x.build).mapBinding(identity)
}


@dom def main = {
  <div><MyComponent foo="Hello, World"/></div>
}

dom.render(document.body, main)
0reactions
vmchuracommented, Mar 29, 2021

Hello, I tried the solutution explained here with @html, but does not compile. dom.Runtime.TagsAndTags2.type is missing. What extra changes do I need to do? Thanks! This library is awesone.

Read more comments on GitHub >

github_iconTop Results From Across the Web

SVG use tag with external reference in IE 11 - Stack Overflow
On IE11 than get the reference from the "use" tag, change it with the path-tag from the svg-sprite. Share.
Read more >
Custom Tags Svg - Etsy Ireland
Check out our custom tags svg selection for the very best in unique or custom, handmade pieces from our clip art & image...
Read more >
Using Custom Fonts With SVG in an Image Tag | CSS-Tricks
When we produce a PNG image, we use an <img> tag or a CSS background, and that's about it. It is dead simple...
Read more >
Automatic folding of specified HTML tags (ie. <svg>)
Hi All! I'm wondering if is there any way to make PHP Storm fold specific tags on file open. What I mean? I...
Read more >
Document Structure — SVG 2
An SVG document fragment can range from an empty fragment (i.e., ... it matches the circle tag name of the element instance, so...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found