Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Document reload when open modal on the same page #234

Open
KhizerWHussain opened this issue Apr 9, 2024 · 2 comments
Open

Document reload when open modal on the same page #234

KhizerWHussain opened this issue Apr 9, 2024 · 2 comments

Comments

@KhizerWHussain
Copy link

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.

@prajilshrestha
Copy link

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

@KhizerWHussain
Copy link
Author

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

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants