From b55567f63dde28fb83f35e1615db9d3699c0de9c Mon Sep 17 00:00:00 2001 From: Ryan Christian Date: Sun, 7 May 2023 17:42:58 -0500 Subject: [PATCH 1/2] fix: Missing `ForwardRefExoticComponent` type in compat --- compat/src/index.d.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/compat/src/index.d.ts b/compat/src/index.d.ts index 02762292bf..1d7fdc6ba7 100644 --- a/compat/src/index.d.ts +++ b/compat/src/index.d.ts @@ -133,6 +133,11 @@ declare namespace React { displayName?: string; } + export interface ForwardRefExoticComponent

+ extends preact.FunctionComponent

{ + defaultProps?: Partial

| undefined; + } + export function forwardRef( fn: ForwardFn ): preact.FunctionalComponent & { ref?: preact.Ref }>; From 528ca0691a0f55a53ff3796b2cebf621063fbf6a Mon Sep 17 00:00:00 2001 From: Ryan Christian Date: Sun, 7 May 2023 18:07:05 -0500 Subject: [PATCH 2/2] fix: Missing `RefAttributes` type in compat --- compat/src/index.d.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/compat/src/index.d.ts b/compat/src/index.d.ts index 1d7fdc6ba7..d968e03c52 100644 --- a/compat/src/index.d.ts +++ b/compat/src/index.d.ts @@ -128,6 +128,10 @@ declare namespace React { ) => boolean ): C; + export interface RefAttributes extends preact.Attributes { + ref?: preact.Ref | undefined; + } + export interface ForwardFn

{ (props: P, ref: ForwardedRef): preact.ComponentChild; displayName?: string;