Skip to content

Commit

Permalink
fix: check SVG node type is not currently supported (#2836)
Browse files Browse the repository at this point in the history
  • Loading branch information
obi-awyss authored Sep 22, 2024
1 parent 885df2b commit 53bf803
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .changeset/pink-owls-drum.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@react-pdf/render": patch
---

[fix] "TypeError: renderFn is not a function"
It may also address issue #2644
4 changes: 2 additions & 2 deletions packages/render/src/primitives/renderSvg.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,10 @@ const renderFns = {
const renderNode = (ctx, node) => {
const renderFn = renderFns[node.type];

if (renderFns) {
if (renderFn) {
renderFn(ctx, node);
} else {
console.warn(`SVG node of type ${node.type} is not currenty supported`);
console.warn(`SVG node of type ${node.type} is not currently supported`);
}
};

Expand Down

0 comments on commit 53bf803

Please sign in to comment.