title: How to import data images from json file
body: <p>I'm using expo react-native. I want to store all my images in one file and from there import it to my components when I need, I just don't know how to write it.</p>
  <p>Right now I used in Clumsy and complicated and unreadable way like this:</p>
  <p>Constant file &quot;Images&quot; to hold all the pictures:</p>
  <pre><code>     export const t1 = require(&quot;../assets/images/t1.jpg&quot;);
       export const t2 = require(&quot;../assets/images/t2.jpg&quot;);
       export const t3 = require(&quot;../assets/images/t3.jpg&quot;);
       export const t4 = require(&quot;../assets/images/t4.jpg&quot;);
       export const s1 = require(&quot;../assets/images/s1.jpg&quot;);
       export const s2 = require(&quot;../assets/images/s2.jpg&quot;);
       export const s3 = require(&quot;../assets/images/s3.jpg&quot;);
       export const s4 = require(&quot;../assets/images/s4.jpg&quot;);
       export const r1 = require(&quot;../assets/images/r1.jpg&quot;);
  </code></pre>
  <p>and from each component that i need the images I just import it:</p>
  <pre><code>   import { t1, t2, t3, t4 } from &quot;./Images&quot;;
      ...
      &lt;Image source={t1} ..........
  </code></pre>
  <p>It works great, but I want to know how to save the constant images in json file I understand that is more efficient way to hold the images</p>
  <p>Thanks a lot</p>