-
Notifications
You must be signed in to change notification settings - Fork 47.7k
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
Bug: can not pass some special custom attribute such as size
#20159
Comments
+1 (React 17.0.1), size is passed to DOM, not component props |
Thanks for the report. React 16.13.1 has the same behavior though. It needs to be a number in
I can see two issues here:
Looks like #12694 discussed this regarding custom components. I could make some implementation arguments about why
Though at a higher level it might be confusing if you overload the Maybe a warning like
|
I can work on adding some warning here! |
I think that react should ignore props doesn't know about them and also maybe there was a size attribute with string value in custom html elements and 3rd-party libraries using Web Components which must be worked without problem as mentioned in docs |
As we know after react 16 we can use any custom attributes in dom elements
but there is a bug which some special attributes (such as
size
) are not forwarding to dom elementReact version: 16.13 & 17.0
Steps To Reproduce
size
Link to code example:
https://codesandbox.io/s/setting-size-as-custom-attr-hdom2?file=/src/App.js
The current behavior
size
attribute will not show in outputThe expected behavior
size
should be in outputThe text was updated successfully, but these errors were encountered: