htmlreactjsimage

image don't show up in react application


i have a component and image in the same foalder

import classes from './Header.module.css'

import React from 'react';

const Header = () => {
    return (
        <div className={classes.header}>
            <div className={classes.logo}>
                <img src="logo.png" alt="Logo"/>
            </div>
        </div>
    );
};

export default Header;

enter image description here

But in browser i see, that browser doesn't see thi image, but in WebStorm if i cover img, i see it.

enter image description here


Solution

  • Move your icon to the public folder of your project. Then try to load your icon.png.