I have a pdf that should download when user clicks on a button. The content for the pdf gets set:
const [instance, updateInstance] = usePDF({
document: (
<PDFDocument projectsData={projectsData} projectId={projectId} />
),
});
When projectsData is updated I call updateInstance. But the content of the PDF still reflects the original projectsData, and not the updated.
I have tried calling updateInstance in a useeffect when projectsData is updated as well.