diegomura / diegomura/react-pdf

Svg does not render if called from View's render function

Open
#2,998 2 comments 1 reaction 0 assignees View on GitHub
Dominant language
TypeScript
Stars
16.8k
Forks
1.3k
Avg merge
5h 6m
Merged PRs (30d)
52

Description

**Description**
The Svg component does not render if used within a View's render function, but does render if used as a child of a View.

**To reproduce:**
[Code Sandbox Example](https://codesandbox.io/p/sandbox/vibrant-babbage-n3yc8w)
If you use Chrome, open the preview in a new window, as at least my Chrome is blocking it.

1. Look at PdfRenderError.tsx where two components are defined.
2. Run the example and see that the first one renders the Svg, the second does not.
3. The only difference is the second one is used within the render function of the View.

**Expected behavior**
I would expect both Svg components to render correctly.

**Screenshots**
![Svg issue](https://github.com/user-attachments/assets/61b3e543-41ef-490f-885c-63bea86a557d)

**Desktop (please complete the following information):**
- OS: Mac, Windows, Android, iOS
- Browser Chrome (all but Android where PDFs are not viewable, but still can be seen by clicking the download button), Firefox, Edge
- React-pdf version 4.1.5

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.