local path image react code example
Example 1: react js image path src from local folder
// Assuming logo.png is in the same folder as JS file
import logo from './logo.png';
// ...later
<img src={logo} alt="logo" />
Example 2: how to write img jsx
<img src={window.location.origin + '/img/myImage.png'} />