title: Returning the value of a promise to another function
body: <p>I'm trying to get the <code>PromiseValue</code> in the renderSelect. (in <code>tmp</code>)</p>
  
  <p>The thing is that I'm getting a promise, which is the normal behavior. But I don't understand how could I get the values inside the Promise so I can work with them.</p>
  
  <p>I have an <code>ApiService</code> class as follows</p>
  
  <pre><code>handleResponse(response) {
    if (response.status &gt;= 200 &amp;&amp; response.status &lt; 300) {
      return response.json();
    }
    return response.json()
      .then((res) =&gt; {
        throw new Error(res.message);
      },
      () =&gt; {
        throw new Error();
      });
  }
  
  
  get(url) {
    return fetch(`${this.API_URL}${url}`, {
      method: 'GET',
      headers: this.headers,
    })
      .then(response =&gt; this.handleResponse(response));
  }
  </code></pre>
  
  <p>And my <code>.jsx</code> like this</p>
  
  <pre><code>const getOptions = (contractor_employee_id) =&gt; {
    const apiService = new ApiService()
    return apiService
      .get(`some_url`)
      .then(
        response =&gt; {
          return ["toto", "tata", "titi"]
      },
      err =&gt; (console.log("Failed"))
      );
  };
  
  const renderSelect = (field) =&gt; {
    const tmp = getOptions(field.id)
    console.log(tmp)
  </code></pre>