Package Exports
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@types/create-react-class) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Installation
npm install --save @types/create-react-class
Summary
This package contains type definitions for create-react-class (https://facebook.github.io/react/).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/create-react-class.
index.d.ts
import { Component, ComponentClass, ComponentLifecycle, ReactNode } from "react";
declare namespace createReactClass {
interface Mixin<P, S> extends ComponentLifecycle<P, S> {
mixins?: Array<Mixin<P, S>> | undefined;
statics?: {
[key: string]: any;
} | undefined;
displayName?: string | undefined;
/**
* Ignored by React.
* @deprecated Only kept in types for backwards compatibility. Will be removed in a futre major release.
*/
propTypes?: any;
getDefaultProps?(): P;
getInitialState?(): S;
}
interface ComponentSpec<P, S> extends Mixin<P, S> {
render(): ReactNode;
[propertyName: string]: any;
}
interface ClassicComponent<P = {}, S = {}> extends Component<P, S> {
replaceState(nextState: S, callback?: () => void): void;
isMounted(): boolean;
getInitialState?(): S;
}
interface ClassicComponentClass<P = {}> extends Omit<ComponentClass<P>, "new"> {
new(props: P, context?: any): ClassicComponent<P, any>;
getDefaultProps?(): P;
}
}
declare function createReactClass<P, S = {}>(
spec: createReactClass.ComponentSpec<P, S>,
): createReactClass.ClassicComponentClass<P>;
export as namespace createReactClass;
export = createReactClass;
Additional Details
- Last updated: Thu, 05 Dec 2024 19:32:25 GMT
- Dependencies: @types/react
Credits
These definitions were written by John Gozde.