Ad
Why Is React.js Removing The Srcset Tag On
?
When I have the srcset
property on my <img />
tag, why doesn't it show up in the browser? It appears as through React.js is stripping it out.
<img src="/images/logo.png" srcset="/images/logo-1.5x.png 1.5x, /images/logo-2x.png 2x" />
Ad
Answer
The solution is to use srcSet
instead of srcset
.
<img src="/images/logo.png" srcSet="/images/logo-1.5x.png 1.5x, /images/logo-2x.png 2x" />
Reference: https://facebook.github.io/react/docs/tags-and-attributes.html under HTML Attributes
Ad
source: stackoverflow.com
Related Questions
- → October CMS create a multi select Form field
- → How to update data attribute on Ajax complete
- → laravel blade templating error
- → should I choose reactjs+f7 or f7+vue.js?
- → How to dynamically add class to parent div of focused input field?
- → Setting the maxlength of text in an element that is displayed
- → Undefined Result for Variable with Javascript innerHTML function
- → Expanding search bar not expanding before search
- → Get the calling element with vue.js
- → Blade: how to include a section in one page but not in another
- → How to print/log reactjs rendered dom?
- → how to write react component to construct HTML DOM
- → How to add a timer in HTML5 and Javascript?
Ad