title: How do I download a pdf file onClick with react-pdf?
body: <p>I want to generate a pdf from the UI and download it. Been looking to the documentation but couldn't find how to implement I.e. <code>onClick={this.downloadPdf}</code></p>
  
  <p>here's the module reference:
  <a href="https://github.com/diegomura/react-pdf" rel="noreferrer">https://github.com/diegomura/react-pdf</a></p>
  
  <p>It says:
  <strong>Save in a file</strong></p>
  
  <pre><code>import React from 'react';
  import ReactPDF from '@react-pdf/react-pdf';
  
  ReactPDF.render(&lt;MyDocument /&gt;, `${__dirname}/example.pdf`);
  </code></pre>
  
  <p>But this doesn't make much sense to me.</p>