react-to-pdf
react-to-pdf copied to clipboard
blank pdf generated in production
in development everything work fine but in production i only see a blank page
const ref = React.createRef();
<div>
// code of the ui that will be printed
</div>
<Pdf targetRef={ref} filename="code-example.pdf">
{({ toPdf }) => <button onClick={toPdf}>Generate Pdf</button>}
</Pdf>
Development :
Production :
Try using the latest version, probably some html2canvas dependency related https://github.com/ivmarcos/react-to-pdf/releases/tag/0.0.14
I'm getting blank PDF even in development mode, Webpack 4.