From 5630ea2dec2ad510c257d6e4ec3696c38cd80b5c Mon Sep 17 00:00:00 2001 From: Dovydas Navickas Date: Wed, 28 Jun 2017 01:25:19 +0300 Subject: [PATCH] Unified type parameter and property types. --- types/react/index.d.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/types/react/index.d.ts b/types/react/index.d.ts index 577959ae7b..621f8203b0 100644 --- a/types/react/index.d.ts +++ b/types/react/index.d.ts @@ -10,8 +10,9 @@ // Eric Anderson // Albert Kurniawan // Tanguy Krotoff +// Dovydas Navickas // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.4 type NativeAnimationEvent = AnimationEvent; type NativeClipboardEvent = ClipboardEvent; @@ -49,7 +50,7 @@ declare namespace React { } interface ReactElement

{ - type: string | ComponentClass

| SFC

; + type: keyof ReactHTML | ComponentClass

| SFC

; props: P; key: Key | null; } @@ -67,7 +68,7 @@ declare namespace React { type ClassicElement

= CElement>; interface DOMElement

, T extends Element> extends ReactElement

{ - type: string; + type: keyof ReactHTML; ref: Ref; } @@ -128,7 +129,7 @@ declare namespace React { function createClass(spec: ComponentSpec): ClassicComponentClass

; function createFactory

, T extends Element>( - type: string): DOMFactory; + type: keyof ReactHTML): DOMFactory; function createFactory

(type: SFC

): SFCFactory

; function createFactory

( type: ClassType, ClassicComponentClass

>): CFactory>;