Skip to content

Commit

Permalink
fix: define renderToStream to return promise (#1681)
Browse files Browse the repository at this point in the history
* fix: define renderToStream to return promise
The old return type was `string` which is wrong, because it returns a `promise` which resolves in a `string` instead.
  • Loading branch information
dschu-lab authored Jan 26, 2022
1 parent 5e32cb9 commit 4eddbf5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/hip-trainers-tickle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@react-pdf/renderer': patch
---

defined renderToStream to return promise
2 changes: 1 addition & 1 deletion packages/renderer/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ declare namespace ReactPDF {
document: React.ReactElement<DocumentProps>,
) => Promise<NodeJS.ReadableStream>;

const renderToString: (document: React.ReactElement<DocumentProps>) => string;
const renderToString: (document: React.ReactElement<DocumentProps>) => Promise<string>;

const renderToFile: (
document: React.ReactElement<DocumentProps>,
Expand Down

0 comments on commit 4eddbf5

Please sign in to comment.