react-pdf icon indicating copy to clipboard operation
react-pdf copied to clipboard

fix: resolve TypeScript error in PDFDownloadLink component react-pdf v4

Open islam-kamel opened this issue 1 year ago • 3 comments

Fixed #2886

Changes Made:

  • Updated PDFDownloadLinkProps to correctly handle the 'children' prop, allowing for both ReactNode and function types.
  • Ensured compatibility with TypeScript type definitions to prevent type mismatches.
  • Added necessary type assertions to preserve functionality.

islam-kamel avatar Sep 26 '24 21:09 islam-kamel

⚠️ No Changeset found

Latest commit: 4a1bdcc68e44c7b96105ca9448ef6e4f7c808a11

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

changeset-bot[bot] avatar Sep 26 '24 21:09 changeset-bot[bot]

Anything i can do to help speed up this PR?

robbycarter avatar Oct 10 '24 11:10 robbycarter

@diegomura sorry for tagging you

mamlzy avatar Oct 18 '24 07:10 mamlzy

I need this PR to be merged...

fatihgnc avatar Nov 07 '24 00:11 fatihgnc

This is still an issue in V4.1.5, is there any fix or workaround for this?

fabianponten avatar Nov 26 '24 15:11 fabianponten

This is still an issue in V4.1.5, is there any fix or workaround for this?

yes i still facing this issue. still using @ts-expect-error to ignoring the type errors

mamlzy avatar Nov 26 '24 15:11 mamlzy

There's an open question in this PR I left on code

diegomura avatar Nov 27 '24 00:11 diegomura

when will this be merged ?

mouchegmouradian avatar Dec 13 '24 14:12 mouchegmouradian

Up. It is a big issue for all typescript users.

Maquinours avatar Dec 16 '24 10:12 Maquinours

I hope we get this resolved before the end of the year.

robbycarter avatar Dec 16 '24 17:12 robbycarter

@robbycarter @Maquinours

Until it's fixed you can do something like this:

Screenshot 2024-12-17 at 11 45 46

the @ts-expect-error is better than @ts-ignore because when this PR is merged and the error isn't there anymore the @ts-expect-error will throw an error itself saying there are no errors, then you can remove it from your code safely.

mouchegmouradian avatar Dec 17 '24 02:12 mouchegmouradian

Thank you !

Maquinours avatar Dec 18 '24 07:12 Maquinours