How to import all images from a folder in ReactJS? : <p>I want to import all images from a folder and want to use as needed.
But can't do it by following methods.
What I am doing?
this: </p>

<pre><code>import * as imageSrc from '../img';
let imageUrl = [];
    imageSrc.map(
    imageUrl.push(img) 
    )) 
</code></pre>

<p>I am getting this error in console.log</p>

<pre><code>index.js:1452 ./src/components/Main.jsx
Module not found: Can't resolve '../img' in 'G:\Projects\Personal\Portfolios\Portfolio_Main\React_portfolio\portfolio\src\components'
</code></pre>

<p>Folder Structure:</p>

<pre><code>src&gt;
  components&gt;
    Main.jsx
  img&gt;
    [all image files]
</code></pre>
