-
Notifications
You must be signed in to change notification settings - Fork 47k
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
Why are attribute names "class" and "for" discouraged? #4331
Comments
The wording there is a bit confusing but here's a short answer: Our DOM components use (mostly) the JS API so we opted to use the JS properties ( You're welcome to use |
If the docs are confusing, we should leave the issue open to fix them. |
I thought the same about the |
Also those keys are hard to add typings to using TypeScript or Flow |
Right, but there are several |
I'd like to see support for direct use of |
It may not come under best practices, but will I face any issues in the future if I use |
In app code I would say it's outright recommendable to use |
From the docs:
But the JSX compiler seems to be smart enough to quote keys like
"class"
and"for"
(so they'll work fine even in pre-ES5 environments). So what's the problem? Why are they discouraged, and what exactly does that mean?The text was updated successfully, but these errors were encountered: