next/image callback when the actual image is fully loaded #24757
martinezleoml
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
|
Not sure if this is the intended behavior, maybe we can consider this as a bug. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the feature you'd like to request
I'd like to trigger a "fade in" animation (using an external animation library such as framer-motion) when the image is fully loaded by
next/image.I planned to use the regular
onLoad()callback but this seems to be called twice by the Image component :Since the event payload is strictly the same, I can't distinguish when the actual image is loaded.
Describe the solution you'd like
It would be nice if a callback function could be fired when the actual image is fully loaded.
Describe alternatives you've considered
I considered to count the
onLoad()calls but it sounds like a dirty way of doing things. :)Beta Was this translation helpful? Give feedback.
All reactions