-
Notifications
You must be signed in to change notification settings - Fork 46.9k
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
should validate attributes by element #5963
Comments
We have a whitelist of attributes, but don't check to ensure they're used on the corresponding tags. With regards to validation, are probably headed in the opposite direction with issues like #140. However, this may be a reason to set the attribute even if we are already setting the property. |
I have tested it...
|
Ah, you are correct. FWIW, we also don't specify the other attributes such as |
My mistake, I have edited... checked/selected are |
I'm going to close this out in favor of #5966, since that's the only actionable part of this issue, as far as I can tell. |
We mistakenly used
required
attribute to stylelabel
element, such asSoon we found that
label
's attribute can not be removed in 0.14.x:After running the above code, The
required
attribute is still onlabel
element.Then I realize
required
is not an attribute oflabel
by standard, just an attribute of some other elements(likeinput
, etc..), so I thinkrequired
should not be allowed to render at component mount phase like other arbitrary names(such as xyz), else it will cause people confusion.And I notice that 0.15.x solves this problem by a flag(
MUST_USE_PROPERTY
), sorequired
is rendered at component mount and will be removed correctly, but is inconsistent with other attributes(select/checked) which is not rendered at all.So should react validate attributes by element like
validateDOMNesting
?The text was updated successfully, but these errors were encountered: