skip to Main Content

I am trying to import and use an image but no matter what path i try it won’t recognize the images.
enter image description here
enter image description here

I even right clicked and did copy path and copy relative path. I tried change where in the directory it was in.

2

Answers


  1. there is an extension on vscode to check if the import of the image is correct, if it’s the preview of the image will show like this:

    enter image description here

    This is the extension, make sure that your image is showing like the mine
    enter image description here

    Login or Signup to reply.
  2. Try import image source is to obtain image source url.

    import tigerImage from '../../assets/images/tiger.jpeg';
    

    and pass this tigerImage as src value

    <Image source={picImage} />
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search