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.

xmlns:xlink (and other SVG namespaced attrs) not supported

See original GitHub issue

At the moment when I try to use a defs element, I get the following error:

Namespace tags are not supported. ReactJSX is not XML.

Namespaces are required for effective use of SVG. Is there a design decision not to allow namespaced tags, or is it just a feature that needs implementing?

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:5
  • Comments:5

github_iconTop GitHub Comments

264reactions
agm1984commented, Feb 27, 2018

In the interest of saving time, the solution is to use camel case:

<svg xlinkHref="http://i.imgur.com/w7GCRPb.png" />

renders to

<svg xlink:href="http://i.imgur.com/w7GCRPb.png" />
1reaction
gbyteinfocommented, Dec 13, 2021

In the interest of saving time, the solution is to use camel case:

<svg xlinkHref="http://i.imgur.com/w7GCRPb.png" />

renders to

<svg xlink:href="http://i.imgur.com/w7GCRPb.png" />

Obrigado agm1984, Lembrando que para <svg xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 24 150 28 " /> Mesma ideia <svg xmlnsXlink="http://www.w3.org/1999/xlink" viewBox="0 24 150 28 " />

por ai vai valew !!!

Read more comments on GitHub >

github_iconTop Results From Across the Web

SyntaxError: unknown: Namespace tags are not supported by ...
In the SVG file, try changing: sketch:type TO sketchType xmlns:xlink TO xmlnsXlink xlink:href TO xlinkHref. etc.
Read more >
Namespaces crash course - SVG: Scalable Vector Graphics
This parameter says that the <svg> element and its child elements belong to whichever XML dialect has the namespace name http://www.w3.org/2000 ...
Read more >
How to solve "Attribute xmlns:b not allowed here" - MSDN
Just to make it clear, HTML5 allows a few "xlink:foo" attributes on SVG elements, so those do not need to be removed. But...
Read more >
Linking — SVG 2
SVG 2 uses an alternative set of attributes in the default namespace that are consistent with HTML links, and deprecates the XLink attributes....
Read more >
Linking — SVG 2 - W3C
An invalid URL does not make an SVG document non-conforming. ... However, it may also generate 'href' attributes in the XLink namespace to...
Read more >

github_iconTop Related Medium Post

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