From 3cf39b0d19e75015c39cf496460d4141f59611f0 Mon Sep 17 00:00:00 2001 From: Hamza Benkhaldoun Date: Sat, 6 Jul 2024 05:07:12 +0100 Subject: [PATCH] Add missing types ElementType and ComponentPropsWithoutRef --- compat/src/index.d.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/compat/src/index.d.ts b/compat/src/index.d.ts index d9656f95a6..e16a76bfe9 100644 --- a/compat/src/index.d.ts +++ b/compat/src/index.d.ts @@ -725,6 +725,13 @@ declare namespace React { | MutableRefObject | null; + export type ElementType

= + | { [K in Tag]: P extends JSX.IntrinsicElements[K] ? K : never }[Tag] + | ComponentType

; + + export type ComponentPropsWithoutRef = PropsWithoutRef>; + + export type ComponentPropsWithRef< C extends ComponentType | keyof JSXInternal.IntrinsicElements > = C extends new (