import img react in another file
//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'
ract import image
import mainLogo from'./logoWhite.png'; <img src={mainLogo} style={nbStyle.logo} alt="fireSpot"/>
Source: stackoverflow.com
import an image in react
import mainLogo from'./logoWhite.png'; //then in the render function of Jsx insert the mainLogo variable class NavBar extends Component { render() { return ( <nav className="nav" style={nbStyle}> <div className="container"> //right below here <img src={mainLogo} style={nbStyle.logo} alt="fireSpot"/> </div> </nav> ); } }
Source: stackoverflow.com