Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SVG support for metal-jsx? #113

Closed
bryceosterhaus opened this issue May 23, 2016 · 3 comments
Closed

SVG support for metal-jsx? #113

bryceosterhaus opened this issue May 23, 2016 · 3 comments
Labels

Comments

@bryceosterhaus
Copy link
Member

bryceosterhaus commented May 23, 2016

Does metal-jsx templating support svgs and their attributes? I am trying to to implement

<svg>
     <use xlink:href="">
     </use>
</svg>

And the xlink:href attribute doesn't seem to work.

One way I got around this was creating an attribute object and using an es6 spread

const xlink = {
    'xlink:href': href
}

<use {...xlink}></use>

Should we add additional parsing for metal-jsx so that xlink:href is supported or just side step the issue by using the attribute object?

@mairatma
Copy link
Contributor

Thanks for reporting this! It seems to be an issue with the tool we're using to compile from jsx to incremental dom. At least when I try using this xlink:href attribute you've mentioned I get a compilation error, so I reported it there to see if we can get a fix.

@mairatma
Copy link
Contributor

This has been fixed on babel-plugin-incremental-dom, and I've updated our preset to enable its usage.

Just make sure that you use version 0.0.3 or higher of babel-preset-metal-jsx (or if you're not using the preset, make sure that babel-plugin-incremental-dom is 3.3.0 or higher and sets namespaceAttributes to true).

@bryceosterhaus
Copy link
Member Author

Thank you!

@mairatma mairatma added the bug label May 27, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants