react-file-viewer
react-file-viewer copied to clipboard
My second open docx or PNG file never showed up
add prop key={urlToFile} it fixed problem
<FileViewer key={file.url} filePath={file.url} fileType={file.type} />
My experience was related to docx.
<div id={docx}>
Essentially because the code uses a static "Id" field, when you have multiple viewers, it won't be able to set the second Tag because they have the same id.
Since the project looks dead (many pull requests that have not been merged), I just copied the DocX viewer and updated it to handle ids
<div id={docx${this.props.id}}>