Skip to content

Commit

Permalink
fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
Christopher J Baker committed Nov 20, 2023
1 parent 8dfe6d0 commit 42da60e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/core/src/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export interface R2WCOptions<Props> {
props?: PropNames<Props> | Partial<Record<PropName<Props>, R2WCType>>
}

export interface R2WCRenderer<Props, Context> {
export interface R2WCRenderer<Props extends R2WCBaseProps, Context> {
mount: (
container: HTMLElement,
ReactComponent: React.ComponentType<Props>,
Expand Down
3 changes: 3 additions & 0 deletions packages/emotion/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions packages/legacy/src/react-to-webcomponent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,5 +110,6 @@ export default function r2wc<Props extends object>(
}
}

//@ts-ignore core uses R2WCBaseProps, but we don't want to impose that on all components
return r2wcCore(ReactComponent, options, { mount, unmount, update })
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,10 @@ function unmount<Props extends R2WCBaseProps>({ root }: Context<Props>): void {
root.unmount()
}

export default function r2wc<Props extends R2WCBaseProps>(
export default function r2wc<Props extends object>(
ReactComponent: React.ComponentType<Props>,
options: R2WCOptions<Props> = {},
): CustomElementConstructor {
//@ts-ignore core uses R2WCBaseProps, but we don't want to impose that on all components
return r2wcCore(ReactComponent, options, { mount, update, unmount })
}

0 comments on commit 42da60e

Please sign in to comment.