From e1f9647734bd990f49b0aca0f44acd4d55fe1e93 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Thu, 21 Feb 2019 10:28:51 +0100 Subject: [PATCH] [react] ReactType -> ElementType --- types/react/index.d.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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,