From 42da60e177571535fde607ad1c1155aa54d6f2f1 Mon Sep 17 00:00:00 2001 From: Christopher J Baker Date: Sun, 19 Nov 2023 23:52:38 -0800 Subject: [PATCH] fix build --- packages/core/src/core.ts | 2 +- packages/emotion/package.json | 3 +++ packages/legacy/src/react-to-webcomponent.ts | 1 + packages/react-to-web-component/src/react-to-web-component.ts | 3 ++- 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/core/src/core.ts b/packages/core/src/core.ts index 54a9c69..1536871 100644 --- a/packages/core/src/core.ts +++ b/packages/core/src/core.ts @@ -11,7 +11,7 @@ export interface R2WCOptions { props?: PropNames | Partial, R2WCType>> } -export interface R2WCRenderer { +export interface R2WCRenderer { mount: ( container: HTMLElement, ReactComponent: React.ComponentType, diff --git a/packages/emotion/package.json b/packages/emotion/package.json index 7228212..59e73e7 100644 --- a/packages/emotion/package.json +++ b/packages/emotion/package.json @@ -42,6 +42,9 @@ "clean": "rm -rf tsconfig.tsbuildinfo dist", "build": "vite build" }, + "dependencies": { + "@r2wc/core": "^1.0.1" + }, "devDependencies": { "@emotion/cache": "^11.11.0", "@emotion/react": "^11.11.1", diff --git a/packages/legacy/src/react-to-webcomponent.ts b/packages/legacy/src/react-to-webcomponent.ts index b0e9f6a..3abffea 100644 --- a/packages/legacy/src/react-to-webcomponent.ts +++ b/packages/legacy/src/react-to-webcomponent.ts @@ -110,5 +110,6 @@ export default function r2wc( } } + //@ts-ignore core uses R2WCBaseProps, but we don't want to impose that on all components return r2wcCore(ReactComponent, options, { mount, unmount, update }) } diff --git a/packages/react-to-web-component/src/react-to-web-component.ts b/packages/react-to-web-component/src/react-to-web-component.ts index 67d9adc..c8983c0 100644 --- a/packages/react-to-web-component/src/react-to-web-component.ts +++ b/packages/react-to-web-component/src/react-to-web-component.ts @@ -41,9 +41,10 @@ function unmount({ root }: Context): void { root.unmount() } -export default function r2wc( +export default function r2wc( ReactComponent: React.ComponentType, options: R2WCOptions = {}, ): CustomElementConstructor { + //@ts-ignore core uses R2WCBaseProps, but we don't want to impose that on all components return r2wcCore(ReactComponent, options, { mount, update, unmount }) }