title: Using require('...') to dynamically import images in react js not working anymore
body: <p>I have old projects where this works</p>
  <pre><code>&lt;img src={require('./logo.svg')} className=&quot;App-logo&quot; alt=&quot;logo&quot; /&gt;
  </code></pre>
  <p>Bu I created a new project with create-react-app and require('...') no longer works. It's like the new version doesn't support require, so how do i load images dynamically ?</p>
  <p>Old project package.json</p>
  <pre><code>&quot;dependencies&quot;: {
  &quot;@testing-library/jest-dom&quot;: &quot;^4.2.4&quot;,
  &quot;@testing-library/react&quot;: &quot;^9.3.2&quot;,
  &quot;@testing-library/user-event&quot;: &quot;^7.1.2&quot;,
  &quot;react&quot;: &quot;^16.13.1&quot;,
  &quot;react-dom&quot;: &quot;^16.13.1&quot;,
  &quot;react-scripts&quot;: &quot;3.4.3&quot;
  }
  </code></pre>
  <p>New project package.json</p>
  <pre><code>&quot;dependencies&quot;: {
  &quot;@testing-library/jest-dom&quot;: &quot;^5.11.4&quot;,
  &quot;@testing-library/react&quot;: &quot;^11.1.0&quot;,
  &quot;@testing-library/user-event&quot;: &quot;^12.1.10&quot;,
  &quot;react&quot;: &quot;^17.0.1&quot;,
  &quot;react-dom&quot;: &quot;^17.0.1&quot;,
  &quot;react-scripts&quot;: &quot;4.0.0&quot;,
  &quot;web-vitals&quot;: &quot;^0.2.4&quot;
  }
  </code></pre>