react-doc-viewer
react-doc-viewer copied to clipboard
feat: add onFetchError prop
Fixes https://github.com/cyntler/react-doc-viewer/issues/266.
Usage:
function App() {
const handleOnFetchError = (error) => {
console.error("Fetch error:", error);
// Add any custom error handling here
};
return (
<div className="App">
<DocViewer
documents={{ uri: "https://example.com/sample.pdf" }}
onFetchError={handleOnFetchError}
/>
</div>
);
}
+1 to get this merged
We use this plugin for medical purposes, so I will be very glad if you will approve this very useful feature:)