Chirag Lathiya
Chirag Lathiya

Reputation: 43

Unable to access loaded & total object in progressEvent of axios request

I'm working on a react native project where I need to make a progress bar for uploading a file.
here is my code, kindly check it out.

axios.post(urlRequest, requestData, { headers: headerConfig, onUploadProgress: function (progressEvent) { console.log('progressEvent : ', progressEvent); console.dir('progressEvent loaded : ', progressEvent.loaded); console.dir('progressEvent total : ', progressEvent.total); }, in the response of this function, I'm getting following console output.
output console screenshot

As you can see here, I'm getting loaded & total object inside Symbol(original_event) but, I can't access them. Any Idea? how can I use them?

Upvotes: 0

Views: 265

Answers (1)

Ram
Ram

Reputation: 432

  1. i think console.dir accepts and returns only object not string 'progressEvent '.
  2. And Path to object you are pointing is wrong progressEvent.Symbol.loaded.

Upvotes: 1

Related Questions