From ae0e37816ab05f58ba28a896b1e8acba6aecdfdc Mon Sep 17 00:00:00 2001 From: obi-awyss <145404001+obi-awyss@users.noreply.github.com> Date: Thu, 1 Aug 2024 12:50:11 -0700 Subject: [PATCH 1/2] fix check SVG node type is not currently supported The check tested the existence of `renderFns` instead of `renderFn`. --- packages/render/src/primitives/renderSvg.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/render/src/primitives/renderSvg.js b/packages/render/src/primitives/renderSvg.js index 4f169410f..a30f936a0 100644 --- a/packages/render/src/primitives/renderSvg.js +++ b/packages/render/src/primitives/renderSvg.js @@ -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`); } }; From b3d77d952c23b2fbab08aeea18fe94c7e76c2070 Mon Sep 17 00:00:00 2001 From: Andrea Wyss Date: Thu, 1 Aug 2024 17:30:03 -0700 Subject: [PATCH 2/2] add changeset --- .changeset/pink-owls-drum.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .changeset/pink-owls-drum.md diff --git a/.changeset/pink-owls-drum.md b/.changeset/pink-owls-drum.md new file mode 100644 index 000000000..d0059020a --- /dev/null +++ b/.changeset/pink-owls-drum.md @@ -0,0 +1,6 @@ +--- +"@react-pdf/render": patch +--- + +[fix] "TypeError: renderFn is not a function" +It may also address issue #2644