Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unknown event handler property onLoadingComplete. It will be ignored. #27867

Closed
jmonster opened this issue Aug 8, 2021 · 4 comments
Closed
Labels
bug Issue was opened via the bug report template.

Comments

@jmonster
Copy link

jmonster commented Aug 8, 2021

What version of Next.js are you using?

11.0.1

What version of Node.js are you using?

14.7.0

What browser are you using?

Safari

What operating system are you using?

macOS

How are you deploying your application?

Vercel

Describe the Bug

Warning: Unknown event handler property `onLoadingComplete`. It will be ignored.

Expected Behavior

onLoadingComplete should be accepted and called

To Reproduce

<Image
  alt={text}
  width={width}
  height={height}
  src={imageWithCaptions}
  onLoadingComplete={() => { console.log("aloha"); }}
/>
@jmonster jmonster added the bug Issue was opened via the bug report template. label Aug 8, 2021
@MathurAditya724
Copy link

What version of Next.js are you using?

11.0.1

What version of Node.js are you using?

14.17.0

What browser are you using?

Firefox

What operating system are you using?

Windows

Describe the Bug

I am experiencing somewhat of the same problem. VS Code is showing an error on this property that, this property does not exist in ImageProps. And even though I run the application, the function is not executed.

here is the code I have written

<Image
  src={src}
  alt={alt}
  width={width}
  height={height}
  layout="responsive"
  onLoadingComplete={() => setIsImageLoaded.on()}
/>

I am trying to create an image fade-in component, so when the image is loaded it will set IsImageLoaded to true, show the image and remove the placeholder image. But this function is not getting called!

@sozdayka
Copy link

sozdayka commented Aug 9, 2021

Faced the same issue and solved it by installing beta 11.0.2

@styfle
Copy link
Member

styfle commented Aug 10, 2021

The docs have been updated in #27440 to include the version that onLoadingComplete was added.

We just released Next.js 11.1.0 so remember to upgrade with yarn add next@latest.

https://nextjs.org/blog/next-11-1

@styfle styfle closed this as completed Aug 10, 2021
@balazsorban44
Copy link
Member

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@vercel vercel locked as resolved and limited conversation to collaborators Jan 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue was opened via the bug report template.
Projects
None yet
Development

No branches or pull requests

5 participants