0

I'm using the Ionic version 5.4.16tag and i used the to display an image in my web app, but the image shows as broken image in when i load the page, why is this happening and how do I fix it; Image is attached below: this is the code i use to create the image:




<!-- language: tsx -->

    <IonRow className="ion-justify-content-center ion-text-center">
    <IonCol></IonCol>
    <IonCol size="3">
      <IonImg src="icon.png" />
      <div className="spinner">erie</div>
    </IonCol>
    <IonCol></IonCol>
    </IonRow>



enter image description here

Tochi Bedford
  • 354
  • 1
  • 9

1 Answers1

1

You must import the image before you use in IonImg component. For instance:

import myImage from './icon.png'

...

<IonImg src={myImage} />
Wesin Alves
  • 371
  • 1
  • 3
  • 13