diegomura / diegomura/react-pdf

Getting Example to work with Next.js & React 19+

Open
#3,020 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
16.8k
Forks
1.3k
Avg merge
5h 6m
Merged PRs (30d)
52

Description

**Describe the bug**
Followed the example in README.MD but had to resolve a few errors. Perhaps adding the below to the example may be useful?
Just got back into react dev so definitely quite new here. Figured sharing this may help others too.

```
"@react-pdf/renderer": "^4.1.6",
"next": "15.1.2",
"react": "^19.0.0",
```

**To Reproduce**
Steps to reproduce the behavior including code snippet (if applies):

Copy & paste example in project.

**Expected behavior**
For example to work.
Major breaking change is `ReactDOM `is obsolete https://legacy.reactjs.org/docs/react-dom.html, use `createRoot `instead https://react.dev/reference/react-dom/client/createRoot#reference

Few other syntax changes required to work with NextJs.

_See solution below in comments_

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**

- OS: Windows
- Browser: Brave
- React-pdf version: 4.1.6

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.