From 37c067910e881b9fff75672bca5aea5502b3e894 Mon Sep 17 00:00:00 2001 From: Wenderson Pires Date: Sat, 11 May 2024 17:02:39 -0300 Subject: [PATCH] fixed issue where a widget prop was not being executed as string (transformWidgetInChildProps method) --- lib/actions/transformSchemaToWidget.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/actions/transformSchemaToWidget.js b/lib/actions/transformSchemaToWidget.js index 894ce1d..1f77008 100644 --- a/lib/actions/transformSchemaToWidget.js +++ b/lib/actions/transformSchemaToWidget.js @@ -355,12 +355,12 @@ const transformWidgetInChildProps = (childProps, fileSchemas) => { let entryValue = entry[1]; // Ignora se nao tiver conteúdo JSX - if (!entryValue.includes("/>")) { + if (typeof entryValue !== "string" || !entryValue.includes("/>")) { return; } const foundJSXs = extractJSX(entryValue); - if (foundJSXs.length > 0) { + if (foundJSXs?.length > 0) { foundJSXs.forEach((jsx) => { const widgetContent = processChildrenWidget(`<>${jsx}`, fileSchemas); entryValue = entryValue.replace(jsx, widgetContent);