title: How to get onUploadProgress value in an await function from axios?
body: <p>I'm relatively new to react and having trouble getting the progress value &quot;progressEvent&quot; of axios in the onUploadProgress callback,</p>
  <p>I have two files, one for the api call and one for my react component:</p>
  <p>Here is a sample of my api.js</p>
  <pre><code>function uploadImage(file) {
          return axios.post('/api/media_objects', file, {
              onUploadProgress: progressEvent =&gt; {
                  let percentComplete = progressEvent.loaded / progressEvent.total
                  percentComplete = parseInt(percentComplete * 100);
                  console.log(percentComplete);
              }
          }).then(response =&gt; response.data.id);
      }
  </code></pre>
  <p>and my try/catch from the component</p>
  <pre><code>try {
      const upload = await xxxAPI.uploadImage(formData);
  
  } catch (error) {
  
      console.log(error);
  }
  </code></pre>
  <p>How can i retrieve in the &quot;try&quot; the &quot;percentComplete&quot; ?</p>
  <p>Thanks !</p>