-
Notifications
You must be signed in to change notification settings - Fork 49.9k
Open
Labels
Status: UnconfirmedA potential issue that we haven't yet confirmed as a bugA potential issue that we haven't yet confirmed as a bug
Description
When a
Reproduced on macOS Safari 18.6
React version: 19.2.0
Steps To Reproduce
- Add the following tags inside a React component JSX :
<picture>
<source
media="(min-width:650px)"
srcSet="https://www.w3schools.com/TAGS/img_pink_flowers.jpg"
/>
<source
media="(min-width:465px)"
srcSet="https://www.w3schools.com/TAGS/img_white_flower.jpg"
/>
<img
src="https://www.w3schools.com/TAGS/img_orange_flowers.jpg"
alt="Flowers"
/>
</picture>
- Open the app on Safari
- Observe that 2 images are downloaded : the one corresponding to the screen size and the fallback image
- Move the
element to the root index.html so it is rendered outside of React - Observe that only the image corresponding to the screen size is downloaded
Link to code example:
https://codesandbox.io/p/sandbox/dreamy-swartz-rfm5wv
The current behavior
The fallback image is being downloaded unnecessarily.
The expected behavior
Only one picture should be downloaded, just like with other browsers.
Metadata
Metadata
Assignees
Labels
Status: UnconfirmedA potential issue that we haven't yet confirmed as a bugA potential issue that we haven't yet confirmed as a bug