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 :

  1. Steps to reproduce the issue or to explain in which case you get the issue https://github.com/SimantaRajSarma/Openpaper
  2. Interesting logs nothing 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

Most upvoted comments

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.json and a recent PR ended up upgrading it to 6.7.6.

Removing the ~ fixed it.

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

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.

onLoadComplete prop is not working in my case as well. I am also using react native v0.76.5 and react native pdf v6.7.6. it was working with react native v0.75.2 but with latest version it is not working.

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.