title: Async Await of imported asynchronous function not waiting correctly
body: <p>I'm flummoxed.</p>
  <p>I have created an asynchronous utility function that I am exporting from one file and importing into a React Class Component.The function makes an API call to an authentication service which returns an object.</p>
  <p>My goal is to be able to call that function in my component and set the returned object equal to a variable called &quot;tokens&quot; which I can then further manipulate.</p>
  <p>My problem is that no matter how I seem to format this i'm unable to get the function in the component to wait for the return of the async function before moving on.</p>
  <p>Here is a simplified version of the utility function:</p>
  <pre><code>// configure and send API request using Axios library
  export const retrieveTokens = async () =&gt; {
    
    // configure request
    var config = {
      // configs
    };
  
    // send request
    axios(config)
      // handle response
      .then(function (response) {
        let cognitoTokens = response.data;
        console.log(&quot;A:&quot;)
        console.log(cognitoTokens);
        return cognitoTokens;
      })
      // handle error
      .catch(function (error) {
        console.log(error);
      });
  };
  </code></pre>
  <p>and then this utility function is being imported into the React Class Component like so:</p>
  <pre><code>import React, { Component } from &quot;react&quot;;
  import { retrieveTokens } from &quot;./utils.js&quot;;
  
  class HeaderLogic extends Component {
    componentDidMount() {
      async function authenticationFlow() {
        let tokens = await retrieveTokens();
        console.log(&quot;B:&quot;);
        console.log(tokens);
  
      }
      authenticationFlow();
    }
  
    render() {
      return &lt;&gt;&lt;/&gt;;
    }
  }
  
  export default HeaderLogic;
  </code></pre>
  <p>My expected result would be:</p>
  <pre><code>A:
  {Tokens}
  
  B:
  {Tokens}
  </code></pre>
  <p>but I am only able to get</p>
  <pre><code>B:
  Undefined
  
  A:
  {Tokens}
  
  </code></pre>
  <p>I have tried various different syntax's and I simply cannot get the console logs in <code>authenticationFlow()</code> to await!</p>