# @rcp/util.iscompclass

> The utility for checking component class

Latest version **2.0.0** (published 2024-02-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install @rcp/util.iscompclass
pnpm add @rcp/util.iscompclass
yarn add @rcp/util.iscompclass
bun add @rcp/util.iscompclass
```

## Health

**Score 35/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2024-02-27 |
| First published | 2018-09-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=6 |
| Dependencies | 1 |
| Unpacked size | 12.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6 |
| Author | imcuttle |
| Maintainers | moyuyc |
| Keywords | imcuttle, react, rcp, component, class, util.iscompinstance |

## Links

- npm: https://www.npmjs.com/package/@rcp/util.iscompclass
- Repository: https://github.com/imcuttle/rcp
- Homepage: https://github.com/imcuttle/rcp#readme
- Issues: https://github.com/imcuttle/rcp/issues
- npm.io page: https://npm.io/package/@rcp/util.iscompclass

## Dependencies (1)

- [is-plain-obj](https://npm.io/package/is-plain-obj.md) ^1.1.0

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 2.0.0 (latest) — 2024-02-27
- 1.0.15 — 2020-11-19
- 1.0.14 — 2020-11-19
- 1.0.13 — 2020-07-04
- 1.0.11 — 2020-07-04
- 1.0.9 — 2020-04-13
- 1.0.8 — 2018-09-14
- 1.0.7 — 2018-09-08
- 1.0.6 — 2018-09-08
- 1.0.5 — 2018-09-07

## README

# @rcp/util.iscompclass

[![NPM version](https://img.shields.io/npm/v/@rcp/util.iscompclass.svg?style=flat-square)](https://www.npmjs.com/package/@rcp/util.iscompclass)
[![NPM Downloads](https://img.shields.io/npm/dm/@rcp/util.iscompclass.svg?style=flat-square&maxAge=43200)](https://www.npmjs.com/package/@rcp/util.iscompclass)

The utility for checking react component class

## Installation

```bash
npm install @rcp/util.iscompclass
# or use yarn
yarn add @rcp/util.iscompclass
```

## Usage

```javascript
import isComponentClass from '@rcp/util.iscompclass'
import * as createClass from 'create-react-class'
import * as React from 'react'

// es6
class View extends React.Component {}
isComponentClass(View) // true

// es5
const Comp = createClass({
  render() {
    return <div>hi</div>
  }
})
isComponentClass(Comp) // true

isComponentClass(<Comp />) // false
```

## API

<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

### isComponentInstance

Determine react component instance

#### Parameters

-   `instance`  {any}

#### Examples

```javascript
import { isComponentInstance } from '@rcp/util.iscompclass'
class View extends React.Component {}

isComponentInstance(View.prototype)
```

Returns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** 

### isComponentClass

-   **See: [how-to-determine-if-js-object-is-react-component](https://discuss.reactjs.org/t/how-to-determine-if-js-object-is-react-component/2825/5)**

Determine react component class

#### Parameters

-   `component`  {any}

Returns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** 

## Related

-   [@rcp/util.iselemof](../util.iselemof) - The utility for determinate the input is element of the component class

## Authors

This library is written and maintained by imcuttle, <a href="mailto:moyuyc95@gmail.com">moyuyc95@gmail.com</a>.

## License

MIT

---
_Source: https://npm.io/package/@rcp/util.iscompclass · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
