Skip to content

Commit 685890b

Browse files
authored
fix: PDFDownloadLinkProps Type Error (#3014)
1 parent 7566e4e commit 685890b

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

.changeset/neat-otters-jump.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@react-pdf/renderer": patch
3+
---
4+
5+
fix: PDFDownloadLinkProps Type Error

packages/renderer/index.d.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -594,11 +594,14 @@ declare namespace ReactPDF {
594594
export class PDFViewer extends React.Component<PDFViewerProps> {}
595595

596596
interface PDFDownloadLinkProps
597-
extends Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'href'> {
597+
extends Omit<
598+
React.AnchorHTMLAttributes<HTMLAnchorElement>,
599+
'href' | 'children'
600+
> {
598601
/** PDF filename. Alias for anchor tag `download` attribute. */
599602
fileName?: string;
600603
document: React.ReactElement<DocumentProps>;
601-
children?: React.ReactNode | React.ReactElement<BlobProviderParams>;
604+
children?: React.ReactNode | React.FC<BlobProviderParams>;
602605
onClick?: React.AnchorHTMLAttributes<HTMLAnchorElement>['onClick'] &
603606
((
604607
event: React.MouseEvent<HTMLAnchorElement, MouseEvent>,

0 commit comments

Comments
 (0)