You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I followed instructions in documentation written for my React-PDF version
I have checked if this bug is not already reported
I have checked if an issue is not listed in Known issues
If I have a problem with PDF rendering, I checked if my PDF renders properly in PDF.js demo
Description
I'm running into an issue where the PDF is infinitely re-rendering if I try to set certain state in onLoadSuccess. I had a suspicion earlier that this was happening because of AWS presigned links, but the example below shows that this happens with public objects with permanent access links too.
#1526 is potentially a related issue although I was able to reproduce this issue in 6.2.2 with the code below unlike OP.
Steps to reproduce
I have a minimal reproducible example below. Things render fine until the setPdf line is uncommented. I don't at all understand why this is triggering re-renders given that pdf isn't used anywhere. Note that this code works fine with local PDF files.
pdf is not set, PDF doesn't render and just shows Loading PDF... indefinitely.
Additional information
There are no errors in console (although previously I was seeing some Transport destroyed errors before I cut down the code to make a minimally reproducible example). A cursory glance at the network tab shows the worker is being called over and over:
Environment
Browser (if applicable): Chrome
React-PDF version: Tested with 6.2.2, 7.3.3, 7.5.1
React version: 18.2.0
Webpack version (if applicable): n/a
The text was updated successfully, but these errors were encountered:
Before you start - checklist
Description
I'm running into an issue where the PDF is infinitely re-rendering if I try to set certain state in
onLoadSuccess
. I had a suspicion earlier that this was happening because of AWS presigned links, but the example below shows that this happens with public objects with permanent access links too.#1526 is potentially a related issue although I was able to reproduce this issue in 6.2.2 with the code below unlike OP.
Steps to reproduce
I have a minimal reproducible example below. Things render fine until the
setPdf
line is uncommented. I don't at all understand why this is triggering re-renders given thatpdf
isn't used anywhere. Note that this code works fine with local PDF files.Expected behavior
Single render,
pdf
is set properlyActual behavior
pdf
is not set, PDF doesn't render and just showsLoading PDF...
indefinitely.Additional information
There are no errors in console (although previously I was seeing some
Transport destroyed
errors before I cut down the code to make a minimally reproducible example). A cursory glance at the network tab shows the worker is being called over and over:Environment
The text was updated successfully, but these errors were encountered: