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 <path> tag unrecognized with React 16 #10955

Closed
ash-vd opened this issue Sep 29, 2017 · 9 comments
Closed

SVG <path> tag unrecognized with React 16 #10955

ash-vd opened this issue Sep 29, 2017 · 9 comments
Labels
Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug

Comments

@ash-vd
Copy link

ash-vd commented Sep 29, 2017

I have an element in which I have code similar to this:

<svg width="100%" height="100%" viewBox="0 0 80 80"> <path ref={(currentLevel) => { this.currentLevel = currentLevel; }} className={styles.svgBorderCurrent} d="M40,10C57.351,10,71,23.649,71,40.5S57.351,71,40.5,71 S10,57.351,10,40.5S23.649,10,40.5,10z" /> </svg>.

The svg and it's paths are rendered, but I get an error in the console:

The tag <path> is unrecognized in this browser. If you meant to render a React component, start its name with an uppercase letter.

What is the right way to render this svg? I never got a message like this in React 15.x.

@gaearon
Copy link
Collaborator

gaearon commented Sep 29, 2017

Please share a complete example reproducing this. Such as a fiddle or a GitHub project. Otherwise it is very hard to fix issues.

@gaearon gaearon added the Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug label Sep 29, 2017
@gaearon
Copy link
Collaborator

gaearon commented Sep 29, 2017

I cannot reproduce this with your example.
Please provide a full reproducing project and say which browser you're using.

screen shot 2017-09-29 at 13 58 43

@ash-vd
Copy link
Author

ash-vd commented Sep 29, 2017

Ah, you found my example :). I was still working on it, because I can't reproduce it there myself. I think it has something to do with the combination of external libraries. I will update the example when I find the time. Thanks!

@gaearon
Copy link
Collaborator

gaearon commented Sep 29, 2017

Oh, I just copy pasted your snippet into an empty page 😛
But it didn't help.

If you can provide an example that would be great.

@gaearon
Copy link
Collaborator

gaearon commented Oct 3, 2017

I’m going to close as this is currently unreproducible.

I suspect that for some reason you were accidentally rendering <path> outside of <svg>. Another possibility is that there’s some bug in how we track namespaces, but we can only check that with a reproducing example.

If you find one, let us know and we can reopen. Or feel free to file a new issue.

Thanks!

@gaearon gaearon closed this as completed Oct 3, 2017
@ericclemmons
Copy link
Contributor

Somewhat related, but you can see similar errors when using something like http://barecss.com/ with custom tags:

<!-- card element -->
<card>
	<p>Your content</p>
</card>

Warning: The tag is unrecognized in this browser. If you meant to render a React component, start its name with an uppercase letter.

Users experiencing this legitimately are likely in the minority, I'm sure.

@gaearon
Copy link
Collaborator

gaearon commented Nov 22, 2017

The site says it explicitly:

Getting a classless grid system means using the very non-standards compliant but totally working grid element.

Cards use the also totally non-compliant card element but works fine in IE9+. These cards are meant to be used within a grid.

This is not great because it prevents standards from actually introducing such elements in the future (since they may break existing websites). I don’t think we’ll be going out of our way to support this.

@ericclemmons
Copy link
Contributor

Oh, I completely understand the implications. I just wanted to add that note that, again, likely a minority of people may see that's not directly related to SVG.

It's a warning, after all. (for those that find this since it's ranked #1 in Google for this warning)

@EightArmCode
Copy link

Spammy spammy spammy. React should not warn us about using elements that are IN THE SPEC.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug
Projects
None yet
Development

No branches or pull requests

4 participants