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
Almost everything is working well, the file is correctly opened and I can navigate through all the pages but I have the following issue : When the document loads for the first time, it does a network request to fetch the file, but then the onSuccess callback is called and this one affect the state (setPageNumbers) causing the document to rerender and so doing again the same network request to fetch the file, this could be seen in the network tab :
I've tried memoizing the file object following this discussion but this didn't change anything :
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm using react-pdf to display a pdf file in the following way :
Almost everything is working well, the file is correctly opened and I can navigate through all the pages but I have the following issue : When the document loads for the first time, it does a network request to fetch the file, but then the onSuccess callback is called and this one affect the state (setPageNumbers) causing the document to rerender and so doing again the same network request to fetch the file, this could be seen in the network tab :
I've tried memoizing the file object following this discussion but this didn't change anything :
Beta Was this translation helpful? Give feedback.
All reactions