v4 passes through unknown HTML attribute to the DOM
See original GitHub issueEnvironment
npm packages:
- react: v16.5.2
- react-dom: v16.5.2
- styled-components: v4.0.2
Reproduction
https://codesandbox.io/s/zn5vrk0vpm
Expected Behavior
https://codesandbox.io/s/20xlp242pr
There is no unknown-prop warning if I’m using styled(styled.button).attrs({ customProp })
with styled-components v3.4.10.
Actual Behavior
There is unknown-prop warning with styled-components v4.
If this is not a bug, and there is something missing. Please let me know, thanks!
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:17 (8 by maintainers)
Top Results From Across the Web
What happens if an invalid/nonstandard HTML attribute is ...
In practice, browsers ignore unknown attributes as far as HTML alone is considered. However, they do not ignore them in CSS; an attribute...
Read more >Unknown Prop Warning - React
The unknown-prop warning will fire if you attempt to render a DOM element with a prop that is not recognized by React as...
Read more >Attributes and properties - The Modern JavaScript Tutorial
When the browser parses the HTML to create DOM objects for tags, it recognizes ... attribute for one element can be unknown for...
Read more >HTML attribute: crossorigin - MDN Web Docs
anonymous. Request uses CORS headers and credentials flag is set to 'same-origin' . There is no exchange of user credentials via cookies ...
Read more >3.2 Elements — HTML5 - W3C
Elements, attributes, and attribute values in HTML are defined (by this specification) ... user agents should pass unknown language tags through unmodified.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Will this be resolved in v5 for the
Link
(or any other custom components)?I’m seeing a similar issue with the new
as
prop, e.g.:Is this related to an existing issue or should I open a new issue?