react-native-pdf: onLoadComplete prop is not getting fired[Android]
What react-native version are you using?
v0.76.5
What react-native-pdf version are you using?
v6.7.6
What platform does your issue occur on? (android/ios/both)
android
Describe your issue as precisely as possible :
- Steps to reproduce the issue or to explain in which case you get the issue
https://github.com/SimantaRajSarma/Openpaper - Interesting
logsnothing Join a screenshot or video of the problem on the simulator or device?
Show us the code you are using?
https://github.com/SimantaRajSarma/Openpaper
About this issue
- Original URL
- State: open
- Created 2 years ago
- Reactions: 8
- Comments: 21 (1 by maintainers)
Commits related to this issue
- Android onLoadComplete 이벤트 발생시키기 https://github.com/wonday/react-native-pdf/issues/899 — committed to knowtilus/react-native-pdf by nadafly0815 a year ago
- Android onLoadComplete 이벤트 발생시키기 https://github.com/wonday/react-native-pdf/issues/899 — committed to knowtilus/react-native-pdf by nadafly0815 a year ago
- Android onLoadComplete 이벤트 발생시키기 https://github.com/wonday/react-native-pdf/issues/899 — committed to knowtilus/react-native-pdf by nadafly0815 a year ago
I believe I found a temporary solution: loadComplete and onPageChanged seem to dispatch at the same time, and loadComplete ends up being ignored. A simple delay on loadComplete seems to work.
react-native-pdf+6.7.6.patch
+1 It is still occurring in react-native-pdf version 6.7.7 and react-native version 0.78.1.
Still happening in react-native-pdf 6.7.7 version with RN 0.76.7.
Hello,
Just confirming what everyone here already knows, onLoadComplete does not fire when using react-native 0.76.5. However, downgrading react-native-pdf to 6.7.5 resolves the issue.
For our apps, reverting to 6.7.5 solves the issue.
We had ~6.7.5 in
package.jsonand a recent PR ended up upgrading it to 6.7.6.Removing the ~ fixed it.
This worked for me.
I used onLoadComplete to get number of pages. The issue also happened for React Native v0.76.6 and React Native PDF v6.7.6. I modified the code to use onPageChanged temporarily to get number of pages.
it is working with react native v0.76.5 and react native pdf v6.7.5
I’ve tested the patch. It works on expo SDK 52 (
react-native=0.76.9) but NOT on SDK 53 (react-native=0.79.2)Still happening in react-native-pdf 6.7.7 version with RN 0.76.7.