react-file-viewer icon indicating copy to clipboard operation
react-file-viewer copied to clipboard

My second open docx or PNG file never showed up

Open mpj658321 opened this issue 4 years ago • 2 comments

Uploading 1637044825(1).jpg…

mpj658321 avatar Nov 16 '21 06:11 mpj658321

add prop key={urlToFile} it fixed problem <FileViewer key={file.url} filePath={file.url} fileType={file.type} />

hightgha avatar Jul 06 '22 11:07 hightgha

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}}>

sseetal avatar Jan 12 '23 09:01 sseetal