react-file-viewer icon indicating copy to clipboard operation
react-file-viewer copied to clipboard

"Deprecated API usage: getDocument" with Functioning Component

Open AdamWhitehurst opened this issue 6 years ago • 1 comments

My team currently has a Component that implements <FileViewer> that works, but our tests warn us that:

console.log node_modules/react-file-viewer/dist/index.js:11
      Deprecated API usage: getDocument is called with pdfDataRangeTransport, passwordCallback or progressCallback argument

Would love to see this updated as react-file-viewer a good library.

Similar issue (but this appears to be a non-functioning component): https://github.com/plangrid/react-file-viewer/issues/83

Relevant information on updating package: https://github.com/mozilla/pdf.js/issues/8538 https://github.com/mozilla/pdf.js/commit/5135aa9becc15a79a565ddf33452e2351196bd5b#diff-dd42e9b2d2a652b8e312efa567698aa6

It appears the call to getDocument simply needs to be updated to the simplified parameters, with callbacks being set with onProgress, onPassword, etc.

AdamWhitehurst avatar Nov 25 '19 20:11 AdamWhitehurst