React: <g> or <text> are unrecognized in Jest

Created on 15 Jul 2019  路  1Comment  路  Source: facebook/react

Do you want to request a feature or report a bug?
BUG
What is the current behavior?
I am using some SVG tags, especially for customized components from recharts library. These customized components tend to fall into this kind of warnings:

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

Same happens for <g> tag or <circle>. It would be nice if Jest can recognize it, or at least ignore it

What is the expected behavior?

Run jest without failing into this warning

Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?
React 16.8.6
Chrome 75.0.3770.100

I think these 3 tags should be specified in after this line https://github.com/facebook/react/blob/67e3f3fb6e342f95f00215c84d5d013d7b0e1b33/packages/react-dom/src/client/ReactDOMComponent.js#L131

If this is a valid issue, and that's the place, I could have a look to add them and adapt the tests to make it work 馃槃

Most helpful comment

I think you're probably rendering them outside of <svg> tags.

>All comments

I think you're probably rendering them outside of <svg> tags.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

zpao picture zpao  路  3Comments

huxiaoqi567 picture huxiaoqi567  路  3Comments

jvorcak picture jvorcak  路  3Comments

varghesep picture varghesep  路  3Comments

Prinzhorn picture Prinzhorn  路  3Comments