I'm trying to generate a PDF based on user input. The user can add, update, and delete items to a list. The list is a redux slice where the state is kept
Adding and updating are working but for some reason when I delete an item. I get the error
Eo is not a function TypeError: Eo is not a function
My initial thought is that how the rendering process works, that the pdf isn't repainted but the existing pdf is changed. Not sure of if I'm in the right direction
PdfPreview.tsx
return (
<PDFViewer key='testing' width="100%" height={window.innerHeight} showToolbar={false}>
<DefaultPdf
personaData={throttledPersonaData}
secondaryColor={props.secondaryColor}
experiences={throttledExperiencesData}
/>
</PDFViewer>
);
DefaultPdf.tsx
<View>
<WorkPdf works={work}/>
</View>
Work.tsx
export const WorkPdf: React.FC<WorkPdfProps> = ({ works }: WorkPdfProps) => {
const t = works.map((v, i) => {
return (
<Text key={i}>{v.role}</Text>
)
})
return (
<View>
<Text >Work</Text>
{t}
</View>
)
}
I can confirm: That the variables that are displayed in the pdf are all strings The array is empty array.
I would have expect that the pdf is repainted and so the items are updated (or in this case, deleted)
The library that is used is react-pdf.
"@react-pdf/renderer": "^4.3.0",
"react": "^19.1.0",