title: Require Image dynamically in React Native
body: <p>The documentation of React native (0.21) states, that it is only possible, to load pictures statically, i.e. if the file name is somehow known in advance:</p>
  
  <blockquote>
    <p>Note that in order for this to work, the image name in require has to be known statically.</p>
  </blockquote>
  
  <p>Source: <a href="https://facebook.github.io/react-native/docs/images.html#content" rel="nofollow">https://facebook.github.io/react-native/docs/images.html#content</a></p>
  
  <p>An example is given:</p>
  
  <pre><code>// GOOD
  &lt;Image source={require('./my-icon.png')} /&gt;
  
  // BAD
  var icon = this.props.active ? 'my-icon-active' : 'my-icon-inactive';
  &lt;Image source={require('./' + icon + '.png')} /&gt;
  </code></pre>
  
  <p>Unfortunately, in my case, I do not know the file names of the pictures in advance, as they are configured in a JSON file.</p>
  
  <p>Is there a way to use <strong>local</strong> image files within react native? I could load them via the <code>file://</code> protocol, if I knew the location of the files? Is there a constant or variable for he location of the app within the <strong>iOS</strong> file system?</p>