cyntler / react-doc-viewer

File viewer for React.
https://cyntler.github.io/react-doc-viewer
Apache License 2.0
392 stars 127 forks source link

feat: add onFetchError prop #282

Open siddydutta opened 3 months ago

siddydutta commented 3 months ago

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>
  );
}
that-one-arab commented 4 weeks ago

+1 to get this merged