Skip to content

Commit af1de4d

Browse files
committed
Address image documentation review
1 parent 788e284 commit af1de4d

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

‎src/content/reference/react-dom/components/img.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ To create an explicit preload hint, call [`preload`](/reference/react-dom/preloa
125125

126126
### Waiting for an image during a View Transition {/*waiting-for-an-image-during-a-view-transition*/}
127127

128-
During a Suspense reveal inside a [`<ViewTransition>`](/reference/react/ViewTransition), React waits up to 500 ms for visible images to load before starting the animation. This includes newly rendered `<img>` elements with a non-empty `src` and existing images whose `src` or `srcSet` changes. React does not wait for images with `loading="lazy"` or an `onLoad` handler.
128+
During a client-rendered [`<ViewTransition>`](/reference/react/ViewTransition) update, React may wait up to 500 ms for visible images to load before starting the animation. This includes newly rendered `<img>` elements with a non-empty `src` and existing images whose `src` or `srcSet` changes. The image must be inside the `<ViewTransition>` subtree and must not have `loading="lazy"` or an `onLoad` handler. React does not wait for images during synchronous updates.
129129

130130
Compare how the same image appears when a Suspense boundary reveals its content inside and outside a `<ViewTransition>`:
131131

@@ -144,7 +144,7 @@ function Profile({ cacheKey }) {
144144
const src = use(fetchImageSrc(cacheKey));
145145
return (
146146
<div className="card">
147-
<img src={src} alt="Jack Pope" width={80} height={80} />
147+
<img src={src} alt="" width={80} height={80} />
148148
<p>Jack Pope</p>
149149
</div>
150150
);

‎src/content/reference/react/Suspense.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3085,7 +3085,7 @@ function Profile({ cacheKey }) {
30853085
const src = use(fetchImageSrc(cacheKey));
30863086
return (
30873087
<div className="card">
3088-
<img src={src} alt="Jack Pope" width={80} height={80} />
3088+
<img src={src} alt="" width={80} height={80} />
30893089
<p>Jack Pope</p>
30903090
</div>
30913091
);
@@ -3215,7 +3215,7 @@ function ProfileCard({ resources }) {
32153215
<>
32163216
<link rel="stylesheet" href={resources.stylesheet} precedence="default" />
32173217
<div className="profile-card">
3218-
<img src={resources.image} alt="Jack Pope" width={80} height={80} />
3218+
<img src={resources.image} alt="" width={80} height={80} />
32193219
<div>
32203220
<p className="name">Jack Pope</p>
32213221
<p className="bio">{quote}</p>
@@ -3302,7 +3302,7 @@ export default function VanillaProfileCard() {
33023302
const quote = await fetchQuote();
33033303
doc.body.innerHTML = `
33043304
<div class="profile-card">
3305-
<img src="${freshImageUrl()}" alt="Jack Pope" width="80" height="80" />
3305+
<img src="${freshImageUrl()}" alt="" width="80" height="80" />
33063306
<div>
33073307
<p class="name">Jack Pope</p>
33083308
<p class="bio">${quote}</p>

0 commit comments

Comments
 (0)