title: Cannot find module './assets/photo.jpg' error in React
body: <p>I am getting a error like this  Cannot find module './assets/photo.jpg'. This the code in app.js</p>
  
  <pre><code>import ReactDOM from 'react-dom';
  import './App.css';
  import Intro from './components/Introduction'
  
  function App() {
    return (
      &lt;div className="outerwrapper"&gt;
        &lt;div className="wrapper2"&gt;
       &lt;Intro content={{ image : "./assets/photo.jpg",
       name : "Hello",
       text : "An undergraduate electrical and electronic engineering student"
  
      }} /&gt;      
   &lt;/div&gt;
  
  &lt;/div&gt;
  </code></pre>
  
  <p>Code in Introduction.js component. I can import the image by entering the location of the image into require function. Also the image won't load without the require function.</p>
  
  <pre><code>import React from 'react';
  
  
  function Intro(props) {
      return (
  
         &lt;div className="Intro"&gt;
             &lt;img src={require(props.content.image)}/&gt;
      &lt;h1&gt;{props.content.name}&lt;/h1&gt;
      &lt;p&gt;{props.content.text}&lt;/p&gt;
      &lt;/div&gt;
  
  )
  }
  export default Intro;
  </code></pre>