diff --git a/compat/src/index.d.ts b/compat/src/index.d.ts
index eaf108fee1..ebff341dfd 100644
--- a/compat/src/index.d.ts
+++ b/compat/src/index.d.ts
@@ -124,7 +124,7 @@ declare namespace React {
): C;
export interface ForwardFn
{
- (props: P, ref: Ref): preact.ComponentChild;
+ (props: P, ref: ForwardedRef): preact.ComponentChild;
displayName?: string;
}
@@ -132,11 +132,21 @@ declare namespace React {
fn: ForwardFn
): preact.FunctionalComponent & { ref?: preact.Ref }>;
+ interface MutableRefObject {
+ current: T;
+ }
+
+ export type ForwardedRef = ((instance: T | null) => void) | MutableRefObject | null;
+
export function unstable_batchedUpdates(
callback: (arg?: any) => void,
arg?: any
): void;
+ export type PropsWithChildren = P & {
+ children?: preact.ComponentChild | undefined
+ };
+
export const Children: {
map(
children: T | T[],
diff --git a/src/index.d.ts b/src/index.d.ts
index 44b5acb71c..06fe433fa5 100644
--- a/src/index.d.ts
+++ b/src/index.d.ts
@@ -39,7 +39,7 @@ export type Key = string | number | any;
export type RefObject = { current: T | null };
export type RefCallback = (instance: T | null) => void;
-export type Ref = RefObject | RefCallback;
+export type Ref = RefObject | RefCallback | null;
export type ComponentChild =
| VNode