diegomura / diegomura/react-pdf
PDFViewer does not render until reloaded
- Dominant language
- TypeScript
- Stars
- 16.8k
- Forks
- 1.3k
- Avg merge
- 5h 6m
- Merged PRs (30d)
- 52
Description
**Describe the bug**
- I have used the to display the PDF in the web app but on the first render the PDFViewer is not shown.
- I have to reload sometimes even multiple times
- I have a condition that checks if the data from the API has arrived before rendering the DOM so I dont think its because of that.
- If there are any **loading states** that I am missing do let me know
- Below is the code snippet
```js
if (
!queryResult.data ||
queryResult.isLoading ||
!userData ||
isLoading ||
!window
)
return ;
return (
);
```
**Screenshots**
First Render =>
After Reloading =>
**Desktop (please complete the following information):**
- OS: Mac, Windows, Linux
- Browser Chrome
- React-pdf version 7.7.3
- @react-pdf/renderer": "^3.4.5
Contributor guide
Assessment
This issue has not been assessed yet.