title: Axios request using URL that includes a variable from a mapped collection
body: <p>I don't think the title does a good job explaining this, so I'm sorry about that. Here's the quick summary. I have a collection that includes a key I need to pull out and append to a URL for an axios.get request. But, I need to map over the collection and make a get request for each key and return the results for each key.</p>
  
  <p>If that doesn't make sense, maybe my terrible code will: </p>
  
  <pre><code>return this.props.wallets.map(wallet =&gt; {
  
    const apiLink = "https://api.smartbit.com.au/v1/blockchain/address/";
    const key = wallet.publicKey;
    const url = apiLink + key;
    this.getData = () =&gt; {
      axios
      .get(
        url
      )
      .then(res =&gt; {
        this.setState({ coins: res.data.address.total.received_int });
      })
      .catch(error =&gt; {
        console.log(error);
      });
    };
  
    let totalBitcoin = this.state.coins/100000000;
  
      return (
        &lt;tr key={wallet._id}&gt;
          &lt;td&gt;
            &lt;Link className="wallet-link" to={link}&gt;
              {wallet.title}
              &lt;span className="glyphicon glyphicon-stats" /&gt;
            &lt;/Link&gt;
          &lt;/td&gt;
          &lt;td&gt;
            {totalBitcoin}
          &lt;/td&gt;
          &lt;td&gt;
            &lt;Link to="/wallets/delete"&gt;
              &lt;span className="glyphicon glyphicon-trash" /&gt;
            &lt;/Link&gt;
          &lt;/td&gt;
        &lt;/tr&gt;
    );
  });
  </code></pre>
  
  <p><code>getData</code> is a function that makes sure I'm only making the get request at a predetermined interval. </p>
  
  <p>So, this almost works. I get the data back, sets all instances in my table of the <code>totalBitcoin</code> variable with the same result. Then it constantly updates that value as the function maps through my collection. </p>
  
  <p>I have no idea how to make this axios request without mapping over my collection to get the necessary variable for the endpoint I'm calling. And I have no idea how to properly set my mapped variable. Any help would be so appreciated. </p>