in next/image onLoad or onLoadingComplete not trigger any function #54756
-
here is my code onLoadingComplete not trigger the handleImageLoaded i am also try onLoad it also not work. can anyone helps with this. "use client" export default function Home() { const handleImageLoaded = () => { console.log("Rendering component. Loading:", loading); // Check if this message appears in the console return ( {loading ? ( ) : ( <Image src={"https://images.pexels.com/photos/12843871/pexels-photo-12843871.jpeg"} width={200} height={200} alt={"image"} onLoadingComplete={handleImageLoaded} /> )} ); } |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
sorry for this i made a mistake {loading ? ( ) : ( ) when i use this it not allow to make render the Image that why the onLoad not trigger |
Beta Was this translation helpful? Give feedback.
sorry for this i made a mistake {loading ? (
) : ( ) when i use this it not allow to make render the Image that why the onLoad not trigger