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

Commit 614d669

Browse files
committed
fix(fw/react): fix hoc types
1 parent 56e9b72 commit 614d669

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

framework/react/hoc.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {
22
createElement,
33
ComponentType,
4-
ExoticComponent,
4+
ComponentPropsWithRef,
55
ReactChild,
66
ReactElement,
77
ReactFragment,
@@ -70,8 +70,8 @@ export function withDeno<T>(callback: () => (T | Promise<T>), revalidate?: numbe
7070
*/
7171
export function dynamic<T extends ComponentType<any>>(
7272
factory: () => Promise<{ default: T }>
73-
): ExoticComponent<T & { fallback?: ReactNode }> {
74-
const DynamicComponent = ({ fallback, ...props }: T & { fallback?: ReactNode }) => {
73+
): ComponentType<ComponentPropsWithRef<T> & { fallback?: ReactNode }> {
74+
const DynamicComponent = ({ fallback, ...props }: ComponentPropsWithRef<T> & { fallback?: ReactNode }) => {
7575
const [mod, setMod] = useState<{ default: T } | null>(null)
7676

7777
useEffect(() => {
@@ -89,5 +89,5 @@ export function dynamic<T extends ComponentType<any>>(
8989
return null
9090
}
9191

92-
return DynamicComponent as ExoticComponent<any>
92+
return DynamicComponent
9393
}

0 commit comments

Comments
 (0)