Revert "Change most uses of ComponentClass<P> to a type that represents the class"

This reverts commit 7bb2b48cd2.

Conflicts:
	react/react.d.ts
This commit is contained in:
Vincent Siao
2015-01-22 18:51:18 -08:00
parent e12488eb5c
commit 54e4632ca7
2 changed files with 9 additions and 10 deletions

View File

@@ -32,7 +32,7 @@ var INPUT_REF: string = "input";
// Top-Level API
// --------------------------------------------------------------------------
var reactClass = React.createClass<Props>({
var reactClass: React.ComponentClass<Props> = React.createClass<Props>({
getDefaultProps: () => {
return <Props>{
hello: undefined,

17
react/react.d.ts vendored
View File

@@ -42,11 +42,7 @@ declare module React {
propTypes?: ValidationMap<P>;
}
interface ComponentClassType<P> extends ComponentStatics<P> {
new (): ComponentClass<P>;
}
interface ComponentClass<P> {
interface ComponentClass<P> extends ComponentStatics<P> {
// Deprecated in 0.12. See http://fb.me/react-legacyfactory
// new(props: P): ReactElement<P>;
// (props: P): ReactElement<P>;
@@ -68,9 +64,9 @@ declare module React {
// ----------------------------------------------------------------------
interface TopLevelAPI {
createClass<P>(spec: ComponentSpec<P, any>): ComponentClassType<P>;
createClass<P>(spec: ComponentSpec<P, any>): ComponentClass<P>;
createElement<P>(type: ComponentClass<P> | string, props: P, ...children: ReactNode[]): ReactElement<P>;
createFactory<P>(componentClass: ComponentClassType<P>): ComponentFactory<P>;
createFactory<P>(componentClass: ComponentClass<P>): ComponentFactory<P>;
render<P>(element: ReactElement<P>, container: Element, callback?: () => any): Component<P>;
unmountComponentAtNode(container: Element): boolean;
renderToString(element: ReactElement<any>): string;
@@ -673,6 +669,9 @@ declare module React {
transitionLeave?: boolean;
}
interface CSSTransitionGroup extends ComponentClass<CSSTransitionGroupProps> {}
interface TransitionGroup extends ComponentClass<TransitionGroupProps> {}
//
// React.addons (Mixins)
// ----------------------------------------------------------------------
@@ -873,10 +872,10 @@ declare module React {
interface AddonsExports extends Exports {
addons: {
CSSTransitionGroup: ComponentClassType<CSSTransitionGroupProps>;
CSSTransitionGroup: CSSTransitionGroup;
LinkedStateMixin: LinkedStateMixin;
PureRenderMixin: PureRenderMixin;
TransitionGroup: ComponentClassType<TransitionGroupProps>;
TransitionGroup: TransitionGroup;
batchedUpdates<A, B>(callback: (a: A, b: B) => any, a: A, b: B): void;
batchedUpdates<A>(callback: (a: A) => any, a: A): void;