yarn react-pdf 10.1.0
v10.1.0

21 days ago

What's new?

  • Added support for functions as children. React-PDF has never been simpler to work with! Say goodbye toonLoadSuccess, say goodbye to setting number of pages in your own state, say goodbye to extra renders! Now, rendering a simple document is as trivial as:
    <Document file="sample.pdf">
      {({ pdf }) => Array(pdf.numPages)
        .fill(null)
        .map((_, index) => <Page key={`page-${index}`} pageIndex={index} />
      ))}
    </Document>
    Thanks @adamaoc for inspiration!
  • Updated PDF.js to 5.3.93.
  • Updated documentation on JPEG 2000 support.
  • Updated dependencies.
  • Exported LinkService type for convenience.

What's changed?

  • usePageContext will now provide non-null value sooner than before, before the page is actually loaded. This is uniform with how useDocumentContext behaves and with how types were designed from the start, so you should not be affected by this change.
  • React-PDF now targets es2018 and not es2017. PDF.js, our core dependency, already used modern JavaScript syntax, so you should not be affected by this change.

Don't miss a new react-pdf release

NewReleases is sending notifications on new releases.