title: user photo in tab navigation
body: <p>In a react native project I am trying to set the user's profile photo as a tabBarIcon in tabNavigation. Below is how I am trying to retrieve the photo path and set it in the source for TabBarIcon.</p>
  
  <p>First I have a token in AsyncStorage that gives me the username, email, or phonenumber of the user after login (works fine). This is in my constructor:</p>
  
  <pre><code>constructor(props) {
    super(props)
  
    this.state = {
      Access: []
    }
  
  }
  </code></pre>
  
  <p>I set the Access in my state to a value in my AsyncStorage with getItem('Access') which i know works fine.</p>
  
  <p>Now i have a function getProfilePhoto where I use fetch to get the profile photo.</p>
  
  <pre><code>getProfilePhoto = () =&gt; {
  
    const { Access } = this.state.access;
  
    fetch('http://urltofiletogetprofilephoto', {
      method: 'POST',
      headers: {
        'Accept':'application/json',
        'Content-Type':'application/json',
      },
      body: JSON.stringify({
        Access:Access
      })
    }).then((response) =&gt; response.json())
      .then((responseJson) =&gt; {
        if(responseJson === 'NULL') {
          console.log('../Images/NoPhoto.png');
        } else {
          console.log('../' + responseJson);
        }
      })
  
  }
  </code></pre>
  
  <p>What I return from that file is:</p>
  
  <pre><code>$profilephoto = $row['ProfilePhoto'];
  $profilephotoJson = json_encode($profilephoto);
  echo $profilephotoJson;
  </code></pre>
  
  <p>That should return something like "Images/userprofilephoto.png". Now in navigationOptions I have this:</p>
  
  <pre><code>static navigationOptions = {
      tabBarLabel: 'Profile',
      tabBarIcon: ({ tintColor }) =&gt; (
          &lt;Image
              source = {this.getProfilePhoto}
              style={[styles.icon, {tintColor: tintColor}]}
          /&gt;
      )
  }
  </code></pre>
  
  <p>I thought calling the function would print the returned Image path, but when I run the app on my device I don't get an error but my tabBarIcon Image is just blank. I am new to react native and haven't worked with Json much I am hoping someone will be able to see something wrong that I am missing!</p>