Skip to content

Commit 67781ee

Browse files
authored
chore(next/image): remove deprecation of onLoadingComplete temporarily (#57020)
- Temporary revert of #56944
1 parent 07c434d commit 67781ee

File tree

3 files changed

+0
-28
lines changed

3 files changed

+0
-28
lines changed

packages/next/src/shared/lib/get-img-props.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,6 @@ export type ImageProps = Omit<
3838
placeholder?: PlaceholderValue
3939
blurDataURL?: string
4040
unoptimized?: boolean
41-
/**
42-
* @deprecated Use `onLoad` instead.
43-
* @see https://nextjs.org/docs/app/api-reference/components/image#onload
44-
*/
4541
onLoadingComplete?: OnLoadingComplete
4642
/**
4743
* @deprecated Use `fill` prop instead of `layout="fill"` or change import to `next/legacy/image`.
@@ -527,12 +523,6 @@ export function getImgProps(
527523
}
528524
}
529525

530-
if (onLoadingComplete) {
531-
warnOnce(
532-
`Image with src "${src}" is using deprecated "onLoadingComplete" property. Please use the "onLoad" property instead.`
533-
)
534-
}
535-
536526
for (const [legacyKey, legacyValue] of Object.entries({
537527
layout,
538528
objectFit,

test/integration/next-image-new/app-dir/test/index.test.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -357,15 +357,6 @@ function runTests(mode) {
357357
() => browser.eval(`document.getElementById("msg9").textContent`),
358358
'loaded 1 img9 with dimensions 400x400'
359359
)
360-
361-
if (mode === 'dev') {
362-
const warnings = (await browser.log('browser'))
363-
.map((log) => log.message)
364-
.join('\n')
365-
expect(warnings).toMatch(
366-
/Image with src "(.*)" is using deprecated "onLoadingComplete" property/gm
367-
)
368-
}
369360
})
370361

371362
it('should callback native onLoad with sythetic event', async () => {

test/integration/next-image-new/default/test/index.test.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -358,15 +358,6 @@ function runTests(mode) {
358358
() => browser.eval(`document.getElementById("msg9").textContent`),
359359
'loaded 1 img9 with dimensions 400x400'
360360
)
361-
362-
if (mode === 'dev') {
363-
const warnings = (await browser.log('browser'))
364-
.map((log) => log.message)
365-
.join('\n')
366-
expect(warnings).toMatch(
367-
/Image with src "(.*)" is using deprecated "onLoadingComplete" property/gm
368-
)
369-
}
370361
})
371362

372363
it('should callback native onLoad with sythetic event', async () => {

0 commit comments

Comments
 (0)