rumax / react-native-PDFView

📚 PDF viewer for React Native
MIT License
300 stars 92 forks source link

With React Navigation, The PDF View Get Dissapers #217

Closed chandni-solanki closed 2 years ago

chandni-solanki commented 2 years ago

Describe the bug For PDF view, while working with react navigation, it gets disappear.

To Reproduce

**Note

DayvsonAlmeida commented 2 years ago

Same issue here. When I go from pdf screen to other screen and go back, the pdf disappears.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

phanvungoc96 commented 2 years ago

same Issue when I move between two tabs has PDF, my PDF disappears and my app crash later on Android

wthew commented 2 years ago

it's possible to work around using useFocusEffect from "react navigation" and reloading the resource prop

sambeetsahu commented 1 year ago

@wthew are yo able to resolve the issue with useFocusEffect and reloading can you please guide on this I am facing the same issue

MuazzezA commented 10 months ago

I found the solution 🥳

First you should use https://reactnavigation.org/docs/use-focus-effect/ . But that's definitely not enough. As a suggestion, you can give the key property to the PDFView component and connect it to the loading status, like key={loading ? 1:0} If you don't use the key, the other one doesn't matter.

I hope it helps.