What is the best way to avoid displaying an image when the screen width is less than 800px:s in next.js? The obvious problem with hiding it in CSS is that the image will still be downloaded by the browser.
Currently I can think of two solutions:
- Using srcset and showing a 1px image as demonstrated here: Suppressing downloads for hidden images using srcset + sizes
- Conditionally load the image client-side
Is there a better approach to this problem?