Still brings in PNGS even when it's a WebP supported browser.
Closed this issue · 1 comments
I brought in this library, and I guess I might be missing something, or I can't get the expected behavior to work.
<Image
style={{width: '100%', height: 500, objectFit: 'cover'}}
webp={require("../../../src/assets/images/banner1.webp")}
src={require("../../../src/assets/images/banner1.png")}
/>
I import image into my project, and when I check the network tab on browser it still shows it bringing in and using the png resource and not the webp resource. I tested to make sure it wasn't a browser issue allowing webp, so I just used this right below the Image
import:
<img style={{width: '100%', height: 500, objectFit: 'cover'}} src={require("../../../src/assets/images/banner2.webp")}/>
and that brings in the WebP image as expected. So I know WebP works on the browser.
Any guidance or help would be appreciated!
Hi @dekkofilms Yes, I had a bug in code. I fixed it and create demo https://donrai.github.io/react-image-webp/examples/index.html
Thank you for informing me!