react-native-pdf
react-native-pdf copied to clipboard
Clarify the type of error in onError
What react-native version are you using?
0.64.0
What react-native-pdf version are you using?
6.3.0
What platform does your issue occur on? (android/ios/both) both
The type of error object returned by onError is object which is unclear. Moreover, the documentation says: if password error, will call OnError() with message "Password required or incorrect password.", which opens lot of doubts:
- Is error a string and I Should write
onError ={error => error.includes('password') && askPassword()}? - Is error of type Error and I should write:
onError={error => error.message.includes('password') && askPassword()} - Can error be something else than an Error and so I should do:
onError={error => error?.message?.includes('password') && askPassword()}?
Just clarifying the type and the documentation about this might help the lib users.
Beside that, thanks a lot for your job!
+1