Document reload when open modal on the same page
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.
The component is causing the the doc viewer to rerender, if you want to handle that use the key={} prop
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