See Upgrade guide from version 10.x to 11.x.
React-PDF 11 brings PDF loading into React's Suspense flow. Use the same loading fallbacks and Error Boundaries as the rest of your application, or keep your existing viewer behavior with suspense={false}.
This release also upgrades PDF.js to version 6, with improvements to rendering, accessibility, and performance, along with some important compatibility changes.
👀 Want to see exciting features more often? Consider sponsoring React-PDF.
❗️ = breaking change
What's new?
- ❗️ Added Suspense and Error Boundary support, enabled by default (#2144).
Document,Page,Thumbnail, andOutlinenow use your boundary fallbacks for loading and failures.- Set
suspense={false}onDocumentto keep the previous loading and error behavior. - Use
startTransitionto keep previously revealed content visible while loading another file or page.
- Updated PDF.js from 5.4.296 to 6.3.289 (#2142), bringing improvements to annotation rendering, image decoding, font conversion, text selection, accessibility, and performance.
What's changed?
- ❗️ React 19 is now required (#2143). Support for React 16.8, 17, and 18 has been dropped.
- ❗️ Dropped support for older browsers and Node.js versions. See the upgrade guide for details.
- ❗️ Several PDF.js APIs have changed. If you use
pdfjsdirectly, document/page proxies, or custom data factories, check the upgrade guide. onRenderAnnotationLayerSuccessnow runs after asynchronous annotation rendering finishes, and rendering failures are reported throughonRenderAnnotationLayerError.- In Suspense mode, plain
fileandoptionsobjects are compared by value.