DEV Community

SriDivya Pulapa
SriDivya Pulapa

Posted on

React PDF packages version upgradation Issues

I have a React Typescript application. Node version: v16.12.0. Below are the versions of react
"react": "^19.1.1",

Here there are three packages related to pdf:
react-pdf-viewer (Latest version: 3.12.0, Existing version in code: 3.4.0)
react-pdf (Latest version: 10.0.1, Existing version in code: 5.7.2)
pdfjs-dist (Latest version: 5.4.54, Existing version in code: 3.11.174)
Both react-pdf-viewer and react-pdf are again internally using pdfjs-dist library, so both 1 & 2 are dependent on 3.

Now if I try to update pdfjs-dist to any versions higher than 3.x, its impacting the react-pdf-viewer performance as its latest version is in 3.x. Facing performance issue like some of the pages in pdf viewer are keeping on loading.

In case of react-pdf, when its updated to higher versions like 7.x and 10.x, I faced issues with duplicating of pages in pdf viewer, extra content being displayed in pdf pages which is not there in original pdf.

Require help on what's a better approach to be considered in this issue and how to proceed further. Thanks in advance.

Top comments (0)