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

Server side rendering: "Warning: <linearGradient /> is using uppercase HTML. Always use lowercase HTML tags in React." #10415

Closed
coreh opened this issue Aug 9, 2017 · 2 comments
Assignees

Comments

@coreh
Copy link

coreh commented Aug 9, 2017

Do you want to request a feature or report a bug?

Report a bug.

What is the current behavior?

Whenever I render SVG elements that are camel cased (e.g. <linearGradient />) on the server side, I get the following warning:

Warning: <linearGradient /> is using uppercase HTML. Always use lowercase HTML tags in React.

What is the expected behavior?

Warnings should be consistent with the client side rendering, if possible. In this case, I'd expect no warning, since using camel cased SVG element names is pretty standard.

For client side rendering, there seems to be a check for the current namespace:

if (namespaceURI === HTML_NAMESPACE) {
if (__DEV__) {
warning(
isCustomComponentTag || type === type.toLowerCase(),
'<%s /> is using uppercase HTML. Always use lowercase HTML tags ' +
'in React.',
type,
);
}

For server side rendering, there seems to be currently no such check in place:

if (__DEV__) {
warning(
tag === element.type,
'<%s /> is using uppercase HTML. Always use lowercase HTML tags ' +
'in React.',
element.type,
);
}

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

Hitting this on 16.0.0-beta.5. Was not hitting it on 15.6.1, the version I was previously on.

Thanks in advance.

@gaearon
Copy link
Collaborator

gaearon commented Aug 9, 2017

Looks like server side is missing the namespace check.

@sophiebits sophiebits self-assigned this Aug 11, 2017
@flarnie flarnie self-assigned this Aug 12, 2017
sophiebits added a commit to sophiebits/react that referenced this issue Aug 13, 2017
sophiebits added a commit to sophiebits/react that referenced this issue Aug 13, 2017
sophiebits added a commit to sophiebits/react that referenced this issue Aug 13, 2017
@BiosBoy
Copy link

BiosBoy commented Mar 9, 2020

Oh, seems like I'm getting this issue too.

In my case, I'm using renderToStaticMarkup on the client-side to put some of the React code into pure HTML body. Don't ask me why :)

Error:
Warning: <linearGradient /> is using incorrect casing. Use PascalCase for React components, or lowercase for HTML elements.

React: 16.12.0
React-Dom: 16.12.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants