I'm trying to track the progress of data upload on my react native app. I use the plugin apiSauce to call my server running locally (node server with baseURL : 192.xxx.x.xx":9000/).
On the front part I called my api using 'apisauce' with the code below :
const apiClient = create({
baseURL: "http://192.xxx.x.xxx:9000/api",
});
return apiClient.post(endpoint, myData, {
onUploadProgress: (progress) => {
console.log(progress.loaded / progress.total);
},
});
From that I except several logs in my console like : 0.1 , 0.2,0.3, ... , 0.9, 1.0 but what I got now is only one log : 1.
I dont understand why onUploadProgress is only fired once, I tried to throttle the network on the android virtual device that I'm using for my test, also running the server with baseURL : 127.0.0.1 doesn't seem to fix my issue.