title: React Native - Assign this.state.var to a variable
body: <p>I need to pass the string "this.state.localita" to var "loc" for fetch data from JSON.</p>
  
  <p>If I print this.state.localita i can read the string, but if I assign that to the var loc it's says JSON Unhandle promise.</p>
  
  <pre><code>componentDidMount() {
    AsyncStorage.getItem("localita").then((value) =&gt; {
        this.setState({"localita": value});
    }).done();
    this._refreshData();
  }
  
  _refreshData() {
    var loc = this.state.localita; // Here is the problem
  
    fetch('https://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20weather.forecast%20where%20woeid%20in%20(select%20woeid%20from%20geo.places(1)%20where%20text%3D%22' +
      loc +'%2C%20Italy%22)&amp;format=json&amp;env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys')
  
    .then((response) =&gt; response.json())
      .then((rjson) =&gt; {
        this.setState({
          dataSource: this.state.dataSource.cloneWithRows(rjson.query.results.channel.item.forecast)
        });
      });
    }
  }
  </code></pre>