Hi i have been trying to download a word file via react.js but when i press submit and it downloades it cant open the word file. The console.logs looks completely fine. If i open the file in notepad it just says readablestream. All help appreciated
onSubmit = () =>{
let data = {data: this.state}
console.log(data)
console.log(JSON.stringify(data))
fetch(this.state.endpoint,{method: 'post', headers: {"Content-Type": "application/json"}, body: JSON.stringify(data)}).then((response) =>{
var blob = new Blob([response], {"Content-type": "application/vnd.openxmlformats-officedocument.wordprocessingml.document" });
saveAs(blob, "dynamic.docx")}
)