From fe3eed3ba15c730be647b8724cbcd36a77ee19f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Murat=20=C3=87orlu?= <127687+muratcorlu@users.noreply.github.com> Date: Fri, 2 Dec 2022 16:26:39 +0100 Subject: [PATCH] fix: react wrapper for component files with multiple exports (#331) --- scripts/generate-react-exports.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/generate-react-exports.js b/scripts/generate-react-exports.js index c33922ce..2c8acb4c 100644 --- a/scripts/generate-react-exports.js +++ b/scripts/generate-react-exports.js @@ -30,7 +30,9 @@ const baklavaReactFileParts = []; for (const module of customElementsModules) { const { declarations, path } = module; - const { events, name: componentName, tagName: fileName } = declarations[0]; + const componentDeclaration = declarations.find(declaration => declaration.customElement === true); + + const { events, name: componentName, tagName: fileName } = componentDeclaration; const eventNames = events ? events.reduce((acc, curr) => {