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

This commit is contained in:
Vincent Siao
2015-01-21 20:17:22 -08:00
parent 4f0eec65af
commit 80fe0ba5de
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

@@ -41,11 +41,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>;
@@ -67,9 +63,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: any/*ReactType*/, props: P, ...children: any/*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;
@@ -674,6 +670,9 @@ declare module React {
transitionLeave?: boolean;
}
interface CSSTransitionGroup extends ComponentClass<CSSTransitionGroupProps> {}
interface TransitionGroup extends ComponentClass<TransitionGroupProps> {}
//
// React.addons (Mixins)
// ----------------------------------------------------------------------
@@ -874,10 +873,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;