turbo-react icon indicating copy to clipboard operation
turbo-react copied to clipboard

Breaks when using inline SVGs

Open olliekav opened this issue 10 years ago • 4 comments

My portfolio site uses quite a few SVGs inline, this breaks with the error...

Uncaught Error: Namespace attributes are not supported. ReactJSX is not XML.

I can get away with removing the namespace on the actual SVG itself, but I'm using

<a xlink:href="/">

To create a linkable logo.

Any way around this? Love the script!

olliekav avatar Feb 15 '15 05:02 olliekav

I will take a look at a workaround for this. It's an intentional limitation of JSX from what I have found, and so it's not a bug from their point of view.

Is your portfolio site public? I'd love to see how you're using TurboReact.

ssorallen avatar Feb 16 '15 01:02 ssorallen

Okay, thanks for having a look. Just ironing out a few last bugs then I'll send you a link. On 16 Feb 2015 09:46, "Ross Allen" [email protected] wrote:

I will take a look at a workaround for this. It's an intentional limitation of JSX from what I have found, and so it's not a bug from their point of view.

Is your portfolio site public? I'd love to see how you're using TurboReact.

— Reply to this email directly or view it on GitHub https://github.com/ssorallen/turbo-react/issues/13#issuecomment-74449984 .

olliekav avatar Feb 16 '15 02:02 olliekav

The React team is still considering how to properly handle SVGs: https://github.com/facebook/react/issues/1657

It might make sense to have a workaround in Reactize until React lands full SVG support, and so I will keep looking. I also want to make Reactize fall back to a full page load if it has any problems converting documents.

ssorallen avatar Feb 16 '15 18:02 ssorallen

Ok, no problem. I'll look at a work around for now. Cheers.

olliekav avatar Feb 17 '15 01:02 olliekav