From 54e4632ca7b4085eab942223d24856edacaa6677 Mon Sep 17 00:00:00 2001 From: Vincent Siao Date: Thu, 22 Jan 2015 18:51:18 -0800 Subject: [PATCH] Revert "Change most uses of ComponentClass

to a type that represents the class" This reverts commit 7bb2b48cd26bf3c83ab63e038c4753b2137bc04b. Conflicts: react/react.d.ts --- 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 5703f093e5..07c8a89d43 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 ec80af795b..f2786cbc88 100644 --- a/react/react.d.ts +++ b/react/react.d.ts @@ -42,11 +42,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

; @@ -68,9 +64,9 @@ declare module React { // ---------------------------------------------------------------------- interface TopLevelAPI { - createClass

(spec: ComponentSpec): ComponentClassType

; + createClass

(spec: ComponentSpec): ComponentClass

; createElement

(type: ComponentClass

| string, props: P, ...children: 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; @@ -673,6 +669,9 @@ declare module React { transitionLeave?: boolean; } + interface CSSTransitionGroup extends ComponentClass {} + interface TransitionGroup extends ComponentClass {} + // // React.addons (Mixins) // ---------------------------------------------------------------------- @@ -873,10 +872,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;