I'm trying to load in an image file that's contained within my src
folder. I'm loading it into App.js
like so:
import React, { Component } from 'react';
import './App.css';
import logo from 'images/logo.png';
class App extends Component {
render() {
return (
<header>
<img src={logo} alt={"logo"}/>
</header>
);
}
}
export default App;
Unfortunately, I get this error:
./src/App.js
Module not found: Can't resolve 'logo.png' in '/src'
I arrived at this code with this Stack Overflow answer: https://stackoverflow.com/a/35454832/7386637 ..but what am I doing wrong here?