html to pdf react

HTML
var doc = new jsPDF();
doc.fromHTML(ReactDOMServer.renderToStaticMarkup(this.render()));
doc.save("myDocument.pdf");import React from "react";
import ReactDOMServer from "react-dom/server";
Source

Also in HTML: