diff --git a/src/widget/index.tsx b/src/widget/index.tsx index 6c36881..257ecf8 100644 --- a/src/widget/index.tsx +++ b/src/widget/index.tsx @@ -24,7 +24,7 @@ function onReady() { ); shadow.appendChild(shadowRoot); - injectStyle(shadowRoot); + injectStyle(shadow); hydrateRoot(shadowRoot, component); document.body.appendChild(element); @@ -33,7 +33,7 @@ function onReady() { } } -function injectStyle(shadowRoot: HTMLElement) { +function injectStyle(shadow: ShadowRoot) { const link = document.createElement('link'); link.rel = 'stylesheet'; const fileName = process.env.WIDGET_NAME || 'widget'; @@ -52,4 +52,4 @@ function getClientKey() { return clientKey; } -initializeWidget(); \ No newline at end of file +initializeWidget();