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) => {