TypeError: Cannot read properties of undefined (reading 'return')
Describe the bug Updating to Version 4.x results in Error TypeError: Cannot read properties of undefined (reading 'return') as soon as updateInstance runs in a useEffect. It worked perfectly on 3.4.5 I don't see anything in the 4.0.0 release that should cause this.
called like this
useEffect(
() => {
updateInstance(
Expected behavior The Template is updated with the new data
Desktop (please complete the following information):
- OS: MacOS, Windows
- Browser: all
- React-pdf version 9.1.1 with react-pdf/renderer at anything over 3.4.5
I'm facing the exact same issue. Love to know if there's a solution for it.
In v4 updateInstace requires a document as param.
E.g.:
updateInstance(
<ReportPDF
theme={selectedTheme}
data={data}
generatedOn={generatedOn}
reportStartTime={reportStartTime}
reportEndTime={reportEndTime}
period={period}
/>,
)
My problem is that changing the theme throws the same return error.
I think this is a duplicate of https://github.com/diegomura/react-pdf/issues/2957