title: react native use navigation prop in fetch
body: <p>I am pretty new to react native. I am using react navigation in my react-native app. I am passing some props from one screen to another, and I need to use one of the props in a fetch I am trying to execute within the <code>componentDidMount</code> lifecycle method. With everything I have tried, it sends the value for the "type" key, but it sends nothing for the "location" key (see code below). Could someone help me with what am I missing or doing wrong? I have tried several things to pass the prop but nothing has worked yet.</p>
  
  <pre><code>  componentDidMount() {
      const { params } = this.props.navigation.state;
      var data = {
        type: 'r',
        location: params.location
      }
      return fetch('http://myapisite', {
            method: 'POST',
            headers: {
              Accept: 'application/json',
              'Content-Type': 'application/json',
            },
            body: JSON.stringify(data)
          }
        )
        .then((response) =&gt; response.json())
        .then((responseJson) =&gt; {
          this.setState({
            isLoading: false,
            dataSource: responseJson,
          }, function() {
            // do something with new state
          });
        })
        .catch((error) =&gt; {
          console.error(error);
        });
    }
  </code></pre>