Skip to content

feat: add onFetchError prop #282

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

siddydutta
Copy link

Fixes #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
Copy link

+1 to get this merged

@yt94kd
Copy link

yt94kd commented Mar 28, 2025

We use this plugin for medical purposes, so I will be very glad if you will approve this very useful feature:)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Need onError prop on <DocViewer/> Component like <DocViewer onError={()=>//error} /> . So that we can show a custom error component
3 participants