title: Require(img path) not working/ cannot find module "." reactjs
body: <p>Hi I am trying to map a set of images from this.state to image tags, using react.js. I am running into the error: "cannot find module '.'"</p>
  
  <p>Here is the error:
      Error: Cannot find module "."
      webpackMissingModule
      src/components/thumbnails.js:26</p>
  
  <pre><code> 23 | }
    24 | render(){
    25 |  const thumbnailimg = this.state.thumbnail_vids.map((img,i)=&gt;{
  &gt; 26 |      let image = require(img);
    27 |      return(&lt;img key={i}  className="thumbimg" src={image}/&gt;)
    28 |     })
    29 |  return(
  </code></pre>
  
  <p>Here is the full code: thumbnails.js</p>
  
  <pre><code>import React, { Component } from "react";
  import { render } from "react-dom";
  
  class Thumbnails extends Component {
      constructor(props){
          super(props);
          this.state = {
              thumbnail_vids: ['../thumbnails/asthma_1.jpeg','../thumbnails/asthma_2.jpeg','../thumbnails/asthma_3.jpeg']
          }
      }
      render(){
          const thumbnailimg = this.state.thumbnail_vids.map((img,i)=&gt;{
              let image = require(img);
              return(&lt;img key={i}  className="thumbimg" src={image}/&gt;)
          })
          return(
              &lt;div&gt;
                  &lt;span className="thumbtable"&gt;
                  &lt;img src={require("../thumbnails/asthma_1.jpeg")} /&gt;
                      {thumbnailimg}
                  &lt;/span&gt;
              &lt;/div&gt;
          )
      }
  }
  
  export default Thumbnails;
  </code></pre>
  
  <p>and here is the project structure for my src folder (though I have abstracted anything unrelated to the question at hand):</p>
  
  <pre><code>        ├── App.css
          ├── App.js
          ├── App.test.js
          ├── components
          │   ├── header.js
          │   ├── likebutton.js
          │   ├── thumbnails.js
          │   └── topicselect.js
          ├── index.css
          ├── index.js
          ├── registerServiceWorker.js
          ├── thumbnails
          │   ├── asthma_1.jpeg
          │   ├── asthma_2.jpeg
          │   ├── asthma_3.jpeg
          │   ├── copd_1.jpeg
          │   ├── copd_2.jpeg
          │   ├── copd_3.jpeg
          │   ├── diabetes_1.jpeg
          │   ├── diabetes_2.jpeg
          │   ├── diabetes_3.jpeg
          │   ├── emphysema_1.jpeg
          │   ├── emphysema_2.jpeg
          │   ├── emphysema_3.jpeg
          │   ├── hyperlipidemia_1.jpeg
          │   ├── hyperlipidemia_2.jpeg
          │   ├── hyperlipidemia_3.jpeg
          │   ├── hypertension_1.jpeg
          │   ├── hypertension_2.jpeg
          │   ├── hypertension_3.jpeg
          │   ├── narcolepsy_1.jpeg
          │   ├── narcolepsy_2.jpeg
          │   ├── narcolepsy_3.jpeg
          │   ├── pneumonia_1.jpeg
          │   ├── pneumonia_2.jpeg
          │   └── pneumonia_3.jpeg
  </code></pre>
  
  <p>I am using create-react-app</p>