-
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: renderToString renders srcSet instead of srcset #19799
Comments
This applies to all camel-cased attributes in React e.g. It was also brought up in #12403 and closed with the following explanation:
Please ping me if there is any actual impact. |
@eps1lon Firefox ignores the |
That's be nice so that we can confirm where the issue originates.
It's not clear if this is actually an issue with React. As said previously: HTML tag names and attribute names are not case-sensitive. User agents should treat |
There's a long history of adapting to what user agents actually do rather than hiding behind what they should do. I'm a bit confused why React would be continuing to ignore this concern for years. Is there any reason at all whatsoever for the current behavior? It's bizarre that React would both 1) complain about me using a lowercase attribute and 2) tell me I shouldn't care about the casing of the attribute, but here we are. |
Chrome appears to also be ignoring srcSet and is loading the src attribute instead off of SSR. When the client re-renders it as srcset it then picks the appropriate size. |
React version: 16.12.0
Steps To Reproduce
renderToString
to render<source>
element withsrcset
attributeLink to code example: https://codesandbox.io/s/react-dom-camelcase-bug-1rnxt
The current behavior
srcSet
isn't transformed tosrcset
The expected behavior
srcSet
becomessrcset
The text was updated successfully, but these errors were encountered: