2

How do I access jobId during the download. I have my download function stored in a separate *.js file

RNFS.downloadFile({
      fromUrl: item.thumb,
      toFile: `${RNFS.DocumentDirectoryPath}/${item.id}.jpg`,
      begin: (res) => {
        console.log(res.jobId, item.id);
      },
    })

I need to call stopDownload function from my UI, so I need to have access to a current jobId and I use Redux as a state manager but I think I'm not supposed to store jobId cause it will cause unnecessary rerenders.

What is the proper way of handling stopDownload?

Aleksandr Fomin
  • 699
  • 5
  • 18

0 Answers0