I have my own component that uses andt I want to select some object in a table and pass it to my component and download it as a pdf.
I tried wrapping my component but nothing happened just my text was gone
const DocumentForPrint = ({ children }) => {
return (
<Document>
<Page size="A4">
{ children }
</Page>
</Document>
)
}
I'm not sure you can wrap you own React component with the react-pdf library. You have to use to given components like or . Depending on your {{ children }} content you have 2 solutions :
DocumentForPrintfunction and work with existing components like View, Text, Image etc.