Closed jiangxiaoqiang closed 4 months ago
It's not downloading multiple times. It's downloading parts of it as you go through the document, avoiding unnecessarily downloading the whole thing and thus speeding up render time.
https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/206
PS. Your code is fine.
Before you start - checklist
Description
Recnently I found loading the PDF will download multiple times:
I have tried to use memo like this:
I have tried to read the https://github.com/wojtekmaj/react-pdf/wiki/Frequently-Asked-Questions but still did not know how to fixed this issue, how to bind the pdfUrl to this? Am I missing something? I have try to print the log, seems only render onece but the download action triggered multiple time. Here is the whole project: https://github.com/RedDwarfTech/texhub-web
Steps to reproduce
Expected behavior
the pdf only load one time with one url
Actual behavior
the pdf only load multiple time with one url
Additional information
the whole source code using react-pdf https://github.com/RedDwarfTech/texhub-web
Environment