diegomura / diegomura/react-pdf

Invalid value for prop render on tag

Open
#2,674 0 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

I can't use properties like render or fixed. I am using react-pdf server-side with Node.js. To render it, I am using react-dom/server:

Screenshot 2024-03-13 at 20 15 46

As you can see, I am using renderToString from react-dom/server to render the PDF content because I need to get the HTML string to save it on the server. The document is displayed correctly, but some properties like `render` or `fixed` are not working, and I am getting the following warnings:

- "Invalid value for prop render on tag. Either remove it from the element, or pass a string or number value to keep it in the DOM."
- " is using incorrect casing. Use PascalCase for React components, or lowercase for HTML elements."
- "Received true for a non-boolean attribute fixed.

This is my code:
![image](https://github.com/diegomura/react-pdf/assets/49483121/956011b4-c618-43a4-b91d-0a849147d611)

My code looks fine, and some part of the PDF are showing despite the errors. But I'm stuck because I can't use properties like render or fixed, which means I can't get the currentPage or totalPages to add page numbers and do some other stuff.

- OS: MacOS
- Browser: Chrome
- React-pdf version: v3.3.8

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.