Summary
I want to use gatsby-image with the picture tag. I need to use picture tag because I have different images for mobile, tablet & desktop resolutions.
Relevant information
This is the current way I do it. Is this the right approach?
<picture>
<source
media="(max-width: 560px)"
srcSet={data.mobile.childImageSharp.fluid.src}
/>
<source
media="(max-width: 875px)"
srcSet={data.tablet.childImageSharp.fluid.src}
/>
<Img src={data.desktop.childImageSharp.fluid.src} />
</picture>
Because its used like this in the docs & I don't know if the method above is right
<Img resolutions={data.file.childImageSharp.resolutions} />
I need 2 things from what I'm doing:
- Optimized Images with Traced SVG in Pages
- Different Images for Mobile, Tablet & Desktop
Is it right what I'm doing or is there another approach?
Summary
I want to use
gatsby-imagewith thepicturetag. I need to usepicturetag because I have different images for mobile, tablet & desktop resolutions.Relevant information
This is the current way I do it. Is this the right approach?
Because its used like this in the docs & I don't know if the method above is right
I need 2 things from what I'm doing:
Is it right what I'm doing or is there another approach?