Unverified Commit 67781ee3 authored by Steven's avatar Steven Committed by GitHub

chore(next/image): remove deprecation of `onLoadingComplete` temporarily (#57020)

- Temporary revert of #56944 
parent 07c434d5
......@@ -38,10 +38,6 @@ export type ImageProps = Omit<
placeholder?: PlaceholderValue
blurDataURL?: string
unoptimized?: boolean
/**
* @deprecated Use `onLoad` instead.
* @see https://nextjs.org/docs/app/api-reference/components/image#onload
*/
onLoadingComplete?: OnLoadingComplete
/**
* @deprecated Use `fill` prop instead of `layout="fill"` or change import to `next/legacy/image`.
......@@ -527,12 +523,6 @@ export function getImgProps(
}
}
if (onLoadingComplete) {
warnOnce(
`Image with src "${src}" is using deprecated "onLoadingComplete" property. Please use the "onLoad" property instead.`
)
}
for (const [legacyKey, legacyValue] of Object.entries({
layout,
objectFit,
......
......@@ -357,15 +357,6 @@ function runTests(mode) {
() => browser.eval(`document.getElementById("msg9").textContent`),
'loaded 1 img9 with dimensions 400x400'
)
if (mode === 'dev') {
const warnings = (await browser.log('browser'))
.map((log) => log.message)
.join('\n')
expect(warnings).toMatch(
/Image with src "(.*)" is using deprecated "onLoadingComplete" property/gm
)
}
})
it('should callback native onLoad with sythetic event', async () => {
......
......@@ -358,15 +358,6 @@ function runTests(mode) {
() => browser.eval(`document.getElementById("msg9").textContent`),
'loaded 1 img9 with dimensions 400x400'
)
if (mode === 'dev') {
const warnings = (await browser.log('browser'))
.map((log) => log.message)
.join('\n')
expect(warnings).toMatch(
/Image with src "(.*)" is using deprecated "onLoadingComplete" property/gm
)
}
})
it('should callback native onLoad with sythetic event', async () => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment