From 80fe0ba5dec4c118c080be8e04d9cc84bc94d6dd Mon Sep 17 00:00:00 2001 From: Vincent Siao Date: Wed, 21 Jan 2015 20:17:22 -0800 Subject: [PATCH] Revert "Change most uses of ComponentClass

to a type that represents the class" --- react/react-tests.ts | 2 +- react/react.d.ts | 17 ++++++++--------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/react/react-tests.ts b/react/react-tests.ts index a6040f6820..338e483a0c 100644 --- a/react/react-tests.ts +++ b/react/react-tests.ts @@ -32,7 +32,7 @@ var INPUT_REF: string = "input"; // Top-Level API // -------------------------------------------------------------------------- -var reactClass = React.createClass({ +var reactClass: React.ComponentClass = React.createClass({ getDefaultProps: () => { return { hello: undefined, diff --git a/react/react.d.ts b/react/react.d.ts index bf66534d2b..2b75bb3fd5 100644 --- a/react/react.d.ts +++ b/react/react.d.ts @@ -41,11 +41,7 @@ declare module React { propTypes?: ValidationMap

; } - interface ComponentClassType

extends ComponentStatics

{ - new (): ComponentClass

; - } - - interface ComponentClass

{ + interface ComponentClass

extends ComponentStatics

{ // Deprecated in 0.12. See http://fb.me/react-legacyfactory // new(props: P): ReactElement

; // (props: P): ReactElement

; @@ -67,9 +63,9 @@ declare module React { // ---------------------------------------------------------------------- interface TopLevelAPI { - createClass

(spec: ComponentSpec): ComponentClassType

; + createClass

(spec: ComponentSpec): ComponentClass

; createElement

(type: any/*ReactType*/, props: P, ...children: any/*ReactNode*/[]): ReactElement

; - createFactory

(componentClass: ComponentClassType

): ComponentFactory

; + createFactory

(componentClass: ComponentClass

): ComponentFactory

; render

(element: ReactElement

, container: Element, callback?: () => any): Component

; unmountComponentAtNode(container: Element): boolean; renderToString(element: ReactElement): string; @@ -674,6 +670,9 @@ declare module React { transitionLeave?: boolean; } + interface CSSTransitionGroup extends ComponentClass {} + interface TransitionGroup extends ComponentClass {} + // // React.addons (Mixins) // ---------------------------------------------------------------------- @@ -874,10 +873,10 @@ declare module React { interface AddonsExports extends Exports { addons: { - CSSTransitionGroup: ComponentClassType; + CSSTransitionGroup: CSSTransitionGroup; LinkedStateMixin: LinkedStateMixin; PureRenderMixin: PureRenderMixin; - TransitionGroup: ComponentClassType; + TransitionGroup: TransitionGroup; batchedUpdates(callback: (a: A, b: B) => any, a: A, b: B): void; batchedUpdates(callback: (a: A) => any, a: A): void;