I am trying to preview .docx file using react-file-viewer
<FileViewer
fileType={'docx'}
filePath={this.state.file} //this.state.file has path of the url data
id="output-frame-id"
allowFullScreen={true}
/>
When the user clicks on the .docx file for preview it throws an exception :
TypeError: Cannot set property 'src' of null
and points to the code below
let srcData = URL.createObjectURL(this.response); // It contains a Response type of blob
error at this line ---> document.querySelector('#output-frame-id').src = srcData;
Any suggestions ?