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

Improve ReactDOM's uppercase HTML warning #12527

Closed
nickserv opened this issue Apr 3, 2018 · 3 comments
Closed

Improve ReactDOM's uppercase HTML warning #12527

nickserv opened this issue Apr 3, 2018 · 3 comments

Comments

@nickserv
Copy link

nickserv commented Apr 3, 2018

Do you want to request a feature or report a bug?
Improvement request/discussion

What is the current behavior?
Rendering <fooBar/> in ReactDOM:

fooBar is using uppercase HTML. Always use lowercase HTML tags in React.

What is the expected behavior?
The warning message can be improved to make it more obvious how to fix the issue for different use cases. For example, it's not obvious from this message that custom components should add dashes or that the first letter should be capitalized if it's actually a React component. Here's my idea, but I'm open to suggestions:

Warning: <foorBar /> looks like an HTML or web component element because it starts with a lowercase letter, but it has uppercase letters instead of dashes. Use PascalCase for React components, or lowercase letters and dashes for HTML.

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

@gaearon
Copy link
Collaborator

gaearon commented Apr 3, 2018

Sure, send a PR?

@wherestheguac
Copy link
Contributor

I jumped on this one since it was quick, PR here: #12533

@gaearon
Copy link
Collaborator

gaearon commented Apr 4, 2018

@nicolevy fixed this in #12533

@gaearon gaearon closed this as completed Apr 4, 2018
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

3 participants