What is the difference between onLoadError, onLoadSucces and onSourceSuccess, onSourceError #881
-
What is the difference between the Document props onLoadError, onLoadSucces and onSourceSuccess, onSourceError? and when should use them ? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
When
During source stage, document is retrieved from
In
|
Beta Was this translation helpful? Give feedback.
When
<Document />
is mounted andfile
prop is provided, React-PDF begins to load your file in two stages:During source stage, document is retrieved from
file
prop.onSourceSuccess
is called when the document source is found and the file is actually about to begin loading or, somewhat controversially now that I think about it, whenfile
is falsy and resolves tonull
, no file.onSourceError
is called when:atob
orunescape
fails when trying to decode binary datafile
is neither a string, nor PDFDataRangeTransport, nor ArrayBuffer, nor Blob (browser only), nor File (browser only), not an object.file
is an object, but neitherurl
, nordata
, norr…