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

Document reload when open modal on the same page

Open KhizerWHussain opened this issue 1 year ago • 2 comments

Hey i am using cyntler / react-doc-viewer, the issue i am facing that in my react mui app i have place document in a page and also a delete button when clicking on delete or edit button it opens the modal for confirm deletion, but at the same time it reloads the document and when modal is closed it agains reload the document. but if i use iframe for pdf rendering or video tag for video rendering it does not rerender or reload when modal is open or close on same page. how to avoid rerendering please.

KhizerWHussain avatar Apr 09 '24 06:04 KhizerWHussain

The component is causing the the doc viewer to rerender, if you want to handle that use the key={} prop

prajilshrestha avatar Apr 23 '24 05:04 prajilshrestha

i have use key prop but it was somehow was not working, so then i use useMemo hook of react now it is working fine

KhizerWHussain avatar Apr 23 '24 09:04 KhizerWHussain