I use usePDF hook to download rendered pdf file, and it works correctly, but when i move to another page and come back to pdf page, button stops working. I check instance after returning from another page and blob file in it becomes null
const [instance, updateInstance] = usePDF({ document: ShowPdf() }) // ShowPdf is a function that returns <document>...pdf content</document>
How can I fix this problem? My library https://react-pdf.org/
Instantiating component as JSX component worked for me -
const [instance, updateInstance] = usePDF({ document: <ShowPdf/> })