title: 'Cannot Find Module' when using an Image in React
body: <p>I am using React and I am running into an issue importing images in a component.  Now I know how to use the import method, which is fine for some things but in this case the image src is part of an array of objects I need to map over.</p>
  <p>So let me start with if I do this directly: <code>&lt;img src={require('../../images/leadinvestigator.jpg')} /&gt;</code>  It works just fine.</p>
  <p>However if I do this: <code>&lt;img src={require(member.image)} /&gt;</code> or <code>&lt;img src={require(</code>${member.image}<code>)} /&gt;</code> I get:</p>
  <p><code>react-dom.development.js:11340 Uncaught Error: Cannot find module '../../images/leadinvestigator.jpg'</code></p>
  <p>and if I do this: <code>&lt;img src={require({member.image})} /&gt;</code> I get an invalid token error</p>
  <p>here is my component code:</p>
  <pre><code>import React from &quot;react&quot;
  import &quot;react-responsive-carousel/lib/styles/carousel.min.css&quot;
  import { Carousel } from 'react-responsive-carousel'
  import './styles.css'
  
  const Crew = () =&gt; {
    const crewMembers = [
      {
        image: '../../images/leadinvestigator.jpg',
        name: 'Bryant Richards',
        title: 'Lead Investigator',
        quote: 'In the end, it only matters what you believe'
      }
    ]
    return (
      &lt;Carousel
        showArrows={true}
        infiniteLoop={true}
        showThumbs={false}
        showStatus={false}
        autoPlay={true}
        interval={6100}
      &gt;
  
        {
          crewMembers ? crewMembers.map(member =&gt; (
            &lt;div&gt;
              &lt;img src={require('../../images/leadinvestigator.jpg')} /&gt;
              &lt;div className=&quot;myCarousel&quot;&gt;
                &lt;h3&gt;{member.name}&lt;/h3&gt;
                &lt;h4&gt;Designer&lt;/h4&gt;
                &lt;p&gt;
                  It's freeing to be able to catch up on customized news and not be
                  distracted by a social media element on the same site
                &lt;/p&gt;
              &lt;/div&gt;
            &lt;/div&gt;
          )) : null
        }
      &lt;/Carousel&gt;
    )
  }
  
  export default Crew
  </code></pre>