diff --git a/types/react/index.d.ts b/types/react/index.d.ts index 2a046f91b8..a2dd9ee144 100644 --- a/types/react/index.d.ts +++ b/types/react/index.d.ts @@ -51,11 +51,15 @@ declare namespace React { // React Elements // ---------------------------------------------------------------------- - type ReactType

= + type ElementType

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

; + /** + * @deprecated Please use `ElementType` + */ + type ReactType

= ElementType

; type ComponentType

= ComponentClass

| FunctionComponent

; type JSXElementConstructor

= @@ -734,11 +738,11 @@ declare namespace React { : T extends keyof JSX.IntrinsicElements ? JSX.IntrinsicElements[T] : {}; - type ComponentPropsWithRef = + type ComponentPropsWithRef = T extends ComponentClass ? PropsWithoutRef

& RefAttributes> : PropsWithRef>; - type ComponentPropsWithoutRef = + type ComponentPropsWithoutRef = PropsWithoutRef>; // will show `Memo(${Component.displayName || Component.name})` in devtools by default,