Skip to content
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

Bug Report: Type Error When Using PDFDownloadLink in Next.js 15.1.3 with TypeScript 5.7.2 and React 19 #3116

Open
Atharva0212 opened this issue Mar 4, 2025 · 0 comments

Comments

@Atharva0212
Copy link

Describe the bug
When using PDFDownloadLink in React 19 with TypeScript (Next.js 15.1.3, TS 5.7.2), an error occurs stating:

"Type '({ loading }: { loading: boolean; }) => React.JSX.Element' is not assignable to type 'ReactNode | ReactElement<BlobProviderParams, string | JSXElementConstructor>'."

This issue happens when using the render prop inside PDFDownloadLink.


To Reproduce
Steps to reproduce the behavior:

  1. Create a Next.js (15.1.3) project with TypeScript (5.7.2).
  2. Install @react-pdf/renderer and use PDFDownloadLink.
  3. Use a render prop inside PDFDownloadLink.
  4. Run the project and observe the TypeScript error.

Here is a Replit example reproducing the issue:
🔗 Reproduction Link


Expected behavior
The PDFDownloadLink should work correctly without TypeScript errors. The loading state should also work as expected.


Screenshots
If applicable, attach screenshots showing the error message.


Desktop (please complete the following information):

  • OS: Windows 10
  • Browser: Chrome
  • React Version: 19
  • Next.js Version: 15.1.3
  • Node.js Version: 22.6.0
  • TypeScript Version: 5.7.2
  • React-PDF Version: 4.1.6

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

No branches or pull requests

1 participant