title: Return a specific string from a Promise
body: <p>I am writing a React/Next.js application and I am using what3words to map items to a location. My code takes in the what3words address, converts it to coordinates, and then is supposed to show the location on a Mapbox map.</p>
  <pre class="lang-js prettyprint-override"><code>const Item = () =&gt; {
    const location = &quot;daring.lion.race&quot;;
    const api = require(&quot;@what3words/api&quot;);
    api.setOptions({ key: &quot;my_api_key&quot; });
    const data = api.convertToCoordinates(location).then((value) =&gt; {
      return value;
    });
  
    const [coords, setCoords] = useState();
  
    async function getCoords() {
      const jason = await data;
      console.log(jason);
      setCoords(jason);
    }
  
    getCoords();
  
    const [viewport, setViewport] = useState({
      width: 1000,
      height: 400,
      latitude: coords.coordinates.lat,
      longitude: coords.coordinates.lng,
      zoom: 16,
    });
  
    return (
      &lt;div&gt;
        &lt;ReactMapGL
          mapStyle=&quot;mapbox://styles/mapbox/outdoors-v11&quot;
          mapboxApiAccessToken=&quot;my_api_key&quot;
          {...viewport}
         &gt;&lt;/ReactMapGL&gt;
      &lt;/div&gt;
    );
  };
  </code></pre>
  <p>The what3words API returns a promise:</p>
  <pre class="lang-json prettyprint-override"><code>{
    &quot;country&quot;: &quot;GB&quot;,
    &quot;square&quot;: {
      &quot;southwest&quot;: {
        &quot;lng&quot;: -0.12552,
        &quot;lat&quot;: 51.508328
      },
      &quot;northeast&quot;: {
        &quot;lng&quot;: -0.125477,
        &quot;lat&quot;: 51.508355
      }
    },
    &quot;nearestPlace&quot;: &quot;London&quot;,
    &quot;coordinates&quot;: {
      &quot;lng&quot;: -0.125499,
      &quot;lat&quot;: 51.508341
    },
    &quot;words&quot;: &quot;daring.lion.race&quot;,
    &quot;language&quot;: &quot;en&quot;,
    &quot;map&quot;: &quot;https://w3w.co/daring.lion.race&quot;
  }
  </code></pre>
  <p>I'm trying to the coordinates out of the promise to put in the viewport, and it doesn't work. I'm using ReactMapGL (<a href="http://visgl.github.io/react-map-gl/" rel="nofollow noreferrer">http://visgl.github.io/react-map-gl/</a>) to display the Mapbox map.</p>