[Resolved] IonImg, ion-img ionImgDidLoad event not firing (Ionic 5)

I’m trying to add a loaded class to IonImg when the image loads. According to docs I should be able to listen to a ionDidLoad event. But it doesn’t seem to trigger.

This is the simple component I’ve created:

const LazyImage = ({src}) => {
  const [ loaded, setLoaded ] = useState();
  return <IonImg src={src} onImgDidLoad={() => setLoaded('loaded')} className={loaded} />
}

Note that I’m using onImgDidLoad instead of ionImgDidLoad as it seems the convention for react is to drop the i for events? I’ve tried both, neither work.

EDIT: SOLVED - It’s a bug in the documentation or I’ve failed to find the docs that indicate that for React the naming convention for events is to prepend on to the documented event and use camelCase. So ionImgDidLoad needs to use the onIonImgDidLoad prop. Correct component:

const LazyImage = ({src}) => {
  const [ loaded, setLoaded ] = useState();
  return <IonImg src={src} onIonImgDidLoad={() => setLoaded('loaded')} className={loaded} />
}