import img react
import shoe1 from './img/shoe_01.jpg'
const Shoe = (e) => {
return (
<div className="shoe-container">
<img src={shoe1} alt=""/>
</div>
);
}//import imgs in a different js file
import lostImage from './assets/img/illustrations/lost.svg';
export { lostImage };
//import in the component to use it
import {lostImage} from './images.js'
//How to import an image in react js
import image from './image-path';
<img src={image} alt="Write something here" />
Also in JavaScript:
- javascript get the last element of json
- javascript number to string
- how to install popper.js in angular 9
- how to compare elements in an array
- tranary operator in js
- js check if variable is string
- make internal value in render function in react native
- javascript get array object by id
- how to delete element at a particular index of array in react js
- javascript save table as excel
- if i pass an object to a function is it the same object javascript
- find smallest length string in an array js
- check if string only contains integer digits numbers javascript
- js obj
- assigned property delete in jquery
- mysql json extract escape
- convert int to float in javascript
- Error:....... EPERM: operation not permitted, mkdi
- js num to string with leading 0
- js remove background image
- in select option how to make one default in angular
- how to reverse loop in javascript
- title case javascript
- program to parenthesize an expression