Skip to content

Upgrade guide from version 1.x to 2.x

Wojciech Maj edited this page Mar 18, 2018 · 2 revisions

Components

ReactPDF component is gone

Instead of a single ReactPDF component, there are now two: Document and Page. Thanks to this change, you can render multiple pages while still loading the file just once.

Consider this basic example:

1.x

<ReactPDF
  file={file}
  pageIndex={0}
/>

2.x

<Document file={file}>
  <Page pageIndex={0} />
</Document>