wonday / react-native-pdf

A <Pdf /> component for react-native
MIT License
1.6k stars 557 forks source link

fix: an issue that crashes when cancel is not present #852

Closed ajakka closed 6 days ago

ajakka commented 4 months ago

I have a use case where the user swipes multiple pdf files, and when the pdf is still loading and user swipes it, the cancel function get fired before its initialized. I fixed it by checking if the cancel function exists before calling it.

ajakka commented 3 months ago

@wonday could you please merge this asap, it's a simple change yet it crashes apps in production, I have to manually change it in node_modules every time a yarn install is invoked.

wise-danya commented 2 months ago

@ajakka you can use patch-package to apply your fix locally after every yarn install without waiting for the PR to be merged.

ajakka commented 2 months ago

@wise-danya Thank you, I was actually so close to deciding to make a new library :D