title: How to dynamically require images in React (using GET request to fetch images)
body: <p>I have a profile picture for each user.</p>
  
  <p>I fetch these pictures <code>paths</code> from my database column.</p>
  
  <p>Then store them in <code>state</code>.</p>
  
  <p><code>const PROFILE_INFO = this.state.PROFILE_INFO;
  &lt;img src={require(PROFILE_INFO.ImageURL)} /&gt; // ImageURL /stored_images/b234afaf-ccea-599f-9b3b-3cbf2d669b21.jpg</code></p>
  
  <p>The problem is this doesn't work because <code>require()</code> only accepts <code>STATIC</code> paths.</p>
  
  <p><a href="https://i.stack.imgur.com/LVUVW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LVUVW.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/dhaqP.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dhaqP.png" alt="enter image description here"></a></p>
  
  <p>This happens when i use</p>
  
  <p><code>&lt;img src={</code>../..${PROFILE_INFO.ImageURL}<code>} /&gt;</code></p>