JSFiddle - React, Tailwind, and code Playground
HTML
<button>Test File</button>
JavaScript
var button = document.getElementsByTagName('button');
function testFile() {
alert(typeof window.File);
try {
var generatedFile = new window.File(["Rough Draft ...."], "Draft1.txt", {type: "text/plain", lastModified: new Date()})
}
catch (ex) {
alert(ex);
}
alert(generatedFile);
}
button[0].onclick = testFile;