I am using jsPDF:

```
import jsPDF from "jspdf";

const noop = () => {};

  const elementRef = React.createRef();

  const savePDF = () => {
    const doc = new jsPDF({
      orientation: "p",
      unit: "pt",
      format: "letter"
    });
    const element = elementRef.current;
    const margins = {
      left: 40,
      top: 40,
      bottom: 40
    };
    const options = {
      width: 500
    };
    doc.fromHTML(element, margins.left, margins.top, options, noop, margins);
    doc.save("hmw.pdf");
  };

```

And within the return:

```
<button onClick={savePDF}>Generate PDF</button>
<div ref={elementRef}>12345</div>

```

However, all I get back on the console is:

```
Uncaught TypeError: doc.fromHTML is not a function

```

If I remove that line, the PDF is created but it comes back blank.

How do I correct this?