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

React v18 unsupported #2078

Closed
alexdhaynes opened this issue Nov 8, 2022 · 15 comments
Closed

React v18 unsupported #2078

alexdhaynes opened this issue Nov 8, 2022 · 15 comments

Comments

@alexdhaynes
Copy link

Is there currently a roadmap for react v18 support?

@alexdhaynes alexdhaynes changed the title React v18 support Will react-pdf support React v18? Nov 8, 2022
@alexdhaynes alexdhaynes changed the title Will react-pdf support React v18? React v18 unsupported Nov 8, 2022
@keslert
Copy link

keslert commented Nov 11, 2022

#1878 #1971. Lots of interest in v18 support.

@carbon-frontend
Copy link

Any rough ETA possible for this change? Eagerly waiting for this update!

@ubRoman
Copy link

ubRoman commented Nov 23, 2022

Please add support for React 18.

@DiegoGonzalezCruz
Copy link

hi! any ETA on react 18?

@orshih6
Copy link

orshih6 commented Nov 28, 2022

hi i'm waiting. :)

@shekhardtu
Copy link

Hi @diegomura , Is there any rough estimate? We eagerly waiting for the react18 support

@crice88
Copy link

crice88 commented Nov 29, 2022

Would love support for React 18! Love the product and would hate to have to migrate off...

@ryandey
Copy link

ryandey commented Dec 13, 2022

Same, would definitely like to see React 18 support when possible

@jeetiss
Copy link
Collaborator

jeetiss commented Dec 13, 2022

Can someone explain what is not working on 18 react or what kind of problems you have?

@ubRoman
Copy link

ubRoman commented Dec 13, 2022

The react dependency is missing react 18+, so the installation and updates went painful with npm as we need to set the flag —legacy-peer-deps, otherwise npm will not let as do any updates at all. On every modul in the project.

@jeetiss
Copy link
Collaborator

jeetiss commented Dec 13, 2022

is this should help then?

@pierremouchan
Copy link

Any updates...?

I saw some workarounds on github and stack overflow but they all seems to not work completely.

@frindly
Copy link

frindly commented Dec 16, 2022

To avoid having to add --legacy-peer-deps when running npm install, you can add an override to your package.json:

"dependencies": {
   ...
    "@react-pdf/renderer": "^3.0.1",
   ...
},
"overrides": {
    "@react-pdf/renderer": {
      "react": "latest"
    }
  }

@gitname
Copy link

gitname commented Dec 16, 2022

In addition to the "overrides" property mentioned by @frindly above 🙌 , if you are using TypeScript and want to use some of the SVG-related components offered by @react-pdf/renderer, you may encounter compiler errors related to passing children to those components.

Here's a write-up about that problem and how I have worked around it. I got the workaround from this comment, written by GitHub user @antoineharel 🙌.

https://gist.github.com/gitname/bdc1fb7fe5bd0c22f6656b7905f57cd6#problem-2-inaccurate-typescript-types

@jeetiss
Copy link
Collaborator

jeetiss commented Dec 23, 2022

duplicate of #1878

@jeetiss jeetiss closed this as completed Dec 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests