Skip to content
This repository was archived by the owner on Jul 6, 2025. It is now read-only.

Commit 08391af

Browse files
committed
fix(fw/react): fix withDeno hoc props
1 parent 901ca70 commit 08391af

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

framework/react/hoc.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export function withRouter<P>(Component: ComponentType<P>) {
2626
* ```tsx
2727
* class MyComponent extends React.Component {
2828
* render() {
29-
* return <p>{this.props.deno.version}</p>
29+
* return <p>{this.props.version}</p>
3030
* }
3131
* }
3232
* export default withDeno(() => ({ version: Deno.version.deno }))(MyComponent)
@@ -39,7 +39,7 @@ export function withDeno<T>(callback: () => (T | Promise<T>), revalidate?: numbe
3939
return function <P extends T>(Component: ComponentType<P>): ComponentType<Exclude<P, keyof T>> {
4040
return function WithDeno(props: Exclude<P, keyof T>) {
4141
const deno = useDeno<T>(callback, revalidate)
42-
return createElement(Component, { ...props, deno })
42+
return createElement(Component, { ...props, ...deno })
4343
}
4444
}
4545
}

0 commit comments

Comments
 (0)