# @types/create-react-class

> TypeScript definitions for create-react-class

Latest version **15.6.9** (published 2024-12-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/create-react-class
pnpm add @types/create-react-class
yarn add @types/create-react-class
bun add @types/create-react-class
```

## Health

**Score 55/100 (C)** — status: stable.

Positive: has types; no vulnerabilities; high maintenance score; popular repo; extremely popular.

Warnings: low downloads; no esm support.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 15.6.9 |
| Published | 2024-12-05 |
| First published | 2017-10-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 5.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51441 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/create-react-class
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/create-react-class
- npm.io page: https://npm.io/package/@types/create-react-class

## Dependencies (1)

- [@types/react](https://npm.io/package/@types/react.md) *

## Recent versions

- 15.6.9 (latest) — 2024-12-05
- 15.6.8 (ts4.7) — 2024-03-23
- 15.6.7 (ts4.6) — 2024-01-06
- 15.6.6 (ts4.5) — 2023-11-07
- 15.6.4 (ts4.3) — 2023-09-04
- 15.6.3 (ts2.8) — 2019-10-17
- 15.6.1 (ts2.6) — 2018-02-12
- 15.6.0 (ts2.3) — 2017-10-17
- 15.6.5 — 2023-10-18
- 15.6.2 — 2018-08-06

## 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](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/create-react-class/index.d.ts)
````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](https://npmjs.com/package/@types/react)

# Credits
These definitions were written by [John Gozde](https://github.com/jgoz).

---
_Source: https://npm.io/package/@types/create-react-class · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
