2👍
✅
let input = window.document.getElementsByClassName("divToPDF");
actually gives you an array of HTML elements whereas html2canvas
expect only one element.
Your problem is fixed with
let input = window.document.getElementsByClassName("divToPDF")[0];
Here a working codesandbox
Source:stackexchange.com