Answers for "how to import image using <img"

12

import img react

//if you have images in src folder
import shoe1 from './img/shoe_01.jpg'
const Shoe = (e) => {
	return ( 
        <div className="shoe-container">
            <img src={shoe1} alt=""/>
        </div>
    );
}
//if you have images in public folder:
//will look in folder /public/img/shoe_01.jpg
const Shoe = (e) => {
	return ( 
        <div className="shoe-container">
            <img src="/img/shoe_01.jpg" alt=""/>
        </div>
    );
}
Posted by: Guest on September-09-2020
7

how to add image in html

<img src="logo.png" />
Posted by: Guest on April-11-2020

Browse Popular Code Answers by Language