I am using the picture element convention for webp with a fallback option. When generated in Create React App - only the default img element src is being rendered in the browser. I've switched the order of the picture source tags to test as well as the img src in Chrome, Firefox and IE, on desktop and mobile.
const ext_1 = ".jpg";
const ext_2 = ".webp";
....
<picture>
<source srcSet={img.src + ext_2} type='image/webp'></source>
<source srcSet={img.src + ext_1} type='image/jpeg'></source>
<img
className={img.className}
id={img.id}
src={img.src + ext_1}
alt={img.alt}
title={img.title}
/>
</picture>
I have already read through all the posts / comments regarding React and Images I could find - none seemed to directly apply, even reading through comments... I am considering using "imbroisi/medium-react-webp", but I'd like to avoid as many dependencies as possible on a SPA project which I'm only trying to reduce the load time on. Any help would be appreciated.