title: How can I have a Dynamic Image uri that is not always defined in React Native?
body: <p>I am trying to get the filename of my image from a fetch to my rest service. But React tries to require the image before the call has the filename so ofcourse it can't find the image and gives me a 500 error back. 
  Is there any way to solve or work around this?</p>
  
  <p>I am trying to get the filename from a json which it gets back from the fetch. </p>
  
  <p>The function in which this is supposed to happen</p>
  
  <pre><code>nextPerson = () =&gt; {
        var numberOfPersons = Object.keys(this.state.peopleList).length;
  
        if (this.state.personIndex &lt; numberOfPersons) {
          person = this.state.peopleList[this.state.personIndex]
          this.setState({currentPerson:person});
  
          this.setState({image : require('../img/' + Object(this.state.currentPerson.gebruikerFoto).url)});
  
          this.state.personIndex++;
        }
      }
  
  </code></pre>
  
  <p>The render of my component</p>
  
  <pre><code>render() {
      var img = this.state.image;
  
        return (
          &lt;View style={styles.container}&gt;
            &lt;Image style={styles.image} source={img} /&gt;
  
            &lt;Text style={styles.persoonNaam}&gt;{this.state.currentPerson.gebruikerNaam}&lt;/Text&gt;
            &lt;Text style={styles.persoonBio}&gt;{this.state.currentPerson.biografie}&lt;/Text&gt;
            &lt;TouchableOpacity onPress={this.likePersoon}&gt;
              &lt;Text&gt;Like&lt;/Text&gt;
            &lt;/TouchableOpacity&gt;
          &lt;/View&gt;
        );
      }
  </code></pre>