react-pdf
react-pdf copied to clipboard
Add support for React 18
Hi, I am trying to use your library on a react v18 project, but I cannot resolve the conflicts. Is there any way to use the library with react v18? Is official support for this version planned anytime soon?
@maguro97 Until an official version appears, you can make it work by doing npm i --legacy-peer-deps
@diegomura Please check this pull request and add the support for react 18, this will be helpful. Thanks
👍🏼
Hi! Can you tell me approximately when is this going to be merged?
Please, I really need this
@diegomura we have 2 approvals here. do we have an approximate date for this PR merge? thank you
Please let me know if there is a chance for PR by the end of this week (15 Aug). Thanks
Just updated to React 18 When will this PR be merged??
This would be great to be accepted as fast as possible :D
Admin, please merge this PR. Its very needed. The earlier the better
@diegomura please there are 2 approvals already for this PR. Kindly merge. I really need this package to complete a project. Thanks
Not sure what is taking so long on this PR. :roll_eyes:
Really considering to fork this and publish it under a different name until this is merged. And of course, remove it after.
@vrinceanuv please do
wating. thank you
Does it support react 18 yet?
@diegomura is there an estimation when this will be merged?
Can someone validate if this does not break support for React 16 or 17? We can drop 16, although Im sure a lot of people still use it. But for 17 we should still provide support. I remember the reconciler bump had issues with it. Sorry for the delay. I don't have enough time these days to test and merge everything 😄
Can someone validate if this does not break support for React 16 or 17? We can drop 16, although Im sure a lot of people still use it. But for 17 we should still provide support. I remember the reconciler bump had issues with it. Sorry for the delay. I don't have enough time these days to test and merge everything 😄
@diegomura, could we have an alpha/beta version with those changes to test in our projects? I can try to test it with React 16, 17 and 18, and give some feedback.
@rasmusrim do you have any information on diegomura's comment, if this PR is breaking react 17 compatibility or if it supports it, if you have tested it?
Can someone validate if this does not break support for React 16 or 17?
For anyone considering testing this branch in React 16 or 17, the author of the branch posted a comment (linked below) containing a link to an NPM package (also linked below) that I assume contains the changes in this branch.
- Comment: https://github.com/diegomura/react-pdf/issues/1878#issuecomment-1230157669
- NPM package: https://www.npmjs.com/package/@react-18-pdf/renderer
Installation command:
$ npm install @react-18-pdf/renderer --save
~~That @react-18-pdf/renderer
NPM package installed OK in my environment (a React 18 environment bootstrapped with CRA v5).~~
Edit: It installed OK, but I could no longer build my app.
Installation aside, I don't know what "validating whether this branch breaks support for React 16 or 17" would involve. Some ideas I have of things that could be checked are:
- [ ] Does it install without errors
- [ ] Are there any specific things the project maintainer wants people to test
- [ ] Can I create an empty PDF
- [ ] Can I create a PDF that contains all of the various element types offered by this project (e.g. text, images, SVG)
- [ ] Can I view a PDF
- [ ] Do all the automated tests in this project pass (I don't know whether there are any)
- [ ] Can I download a PDF
~~Anyway, at this point, I don't plan on doing that validation work. I don't use React 16 or 17 on my projects.~~ I am willing to do some of the validation work, provided I know what the specific validation criteria are (i.e. "what done looks like" to person who would be deciding whether or not to merge this branch).
Installation aside, I don't know what "validating whether this branch breaks support for React 16 or 17" would involve.
- [ ] Are there any specific things the project maintainer wants people to test
Hi @diegomura, is there a documented "test/validation procedure" for this project; e.g. a checklist that someone goes through when making major changes to the project, in order to detect regressions? If not, are there specific things you suggest people test in order to validate whether this branch breaks support for React 16 or 17?
Hi @diegomura is there any update about this merge?
Looking forward for some info about it as well
Looking forward to it as well, currently having to use craco to use this in my react 18 app.
Still waiting...
Sadly npm i --legacy-peer-deps true
doesnt work & gives a Cannot create property '_updatedFibers' on number '0' at requestUpdateLane
error. Any workaround this for now?
I have other dependencies which are already on 18.2.0
version so I cant roll back either 😬
Thanks!
Sadly
npm i --legacy-peer-deps true
doesnt work & gives aCannot create property '_updatedFibers' on number '0' at requestUpdateLane
error. Any workaround this for now?I have other dependencies which are already on
18.2.0
version so I cant roll back either 😬Thanks!
Have you tried the one for React 18?
npm install @react-18-pdf/renderer --save
Have you tried the one for React 18?
npm install @react-18-pdf/renderer --save
Getting this error
node_modules/@react-18-pdf/layout/lib/index.es.js:20:17: Cannot resolve dependency '@react-18-pdf/yoga'
18 | import resolveImage from '@react-18-pdf/image';
19 | import flatten from '@react-18-pdf/stylesheet/lib/flatten';
> 20 | import Yoga from '@react-18-pdf/yoga';
| ^