Rookie question

Hey guys and gals! I’m working on a web page build. For the life of me I can’t seem to get this avatar.png file to show. I’ve taken a screenshot of the code/filestructure.

you need to import the image first:

import avatar from './path/to/avatar.png'
//use it
<img src={avatar} />

I’m no expert here, but my understanding is…

When you refer to the url in img element, it has to be relative to your public folder. For example, if you moved the assets folder to the public folder, you could refer to it with `src="./assets/avatar.jpg". If you want to refer to it in src directory, you would want to import it.

import myImg from '../assets/avatar.jpg';
// ...
<img src={myImg} ...

I can’t test it right now, but that’s what I remember.

Thank you! Thats a good reminder, got so focused, I completely forgot its relative to public. Thank you!