# react-is

> Brand checking of React Elements.

Latest version **19.3.0** (published 2026-09-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-is
pnpm add react-is
yarn add react-is
bun add react-is
```

## Health

**Score 73/100 (B)** — status: active.

Positive: has types package; no vulnerabilities; has provenance; recently updated; high maintenance score; popular repo; extremely popular.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 19.3.0 |
| Published | 2026-09-09 |
| First published | 2017-10-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/react-is) |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 13.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 250697 |
| Maintainers | fb, react-bot |
| Keywords | react |

## Links

- npm: https://www.npmjs.com/package/react-is
- Repository: https://github.com/react/react
- Homepage: https://react.dev/
- Issues: https://github.com/react/react/issues
- npm.io page: https://npm.io/package/react-is

## 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

- 19.3.0 (latest) — 2026-09-09
- 0.0.0-experimental-d083ec1d-20260922 (experimental) — 2026-09-23
- 19.3.0-canary-d083ec1d-20260922 (canary) — 2026-09-23
- 19.0.8 (backport) — 2026-07-21
- 19.3.0-canary-d5736f09-20260507 (next) — 2026-05-08
- 19.0.0-rc.1 (rc) — 2024-11-14
- 19.0.0-beta-26f2496093-20240514 (beta) — 2024-05-14
- 0.0.0-experimental-8b0da1c6-20260922 — 2026-09-22
- 19.3.0-canary-8b0da1c6-20260922 — 2026-09-22
- 0.0.0-experimental-59aff3e1-20260918 — 2026-09-18
- 19.3.0-canary-59aff3e1-20260918 — 2026-09-18
- 0.0.0-experimental-2b19aecd-20260916 — 2026-09-16
- 19.3.0-canary-2b19aecd-20260916 — 2026-09-16
- 0.0.0-experimental-ff8f88fc-20260915 — 2026-09-15
- 19.3.0-canary-ff8f88fc-20260915 — 2026-09-15
- … 2800 more at https://npm.io/package/react-is/versions

## README

# `react-is`

This package allows you to test arbitrary values and see if they're a particular React element type.

## Installation

```sh
# Yarn
yarn add react-is

# NPM
npm install react-is
```

## Usage

### Determining if a Component is Valid

```js
import React from "react";
import * as ReactIs from "react-is";

class ClassComponent extends React.Component {
  render() {
    return React.createElement("div");
  }
}

const FunctionComponent = () => React.createElement("div");

const ForwardRefComponent = React.forwardRef((props, ref) =>
  React.createElement(Component, { forwardedRef: ref, ...props })
);

const Context = React.createContext(false);

ReactIs.isValidElementType("div"); // true
ReactIs.isValidElementType(ClassComponent); // true
ReactIs.isValidElementType(FunctionComponent); // true
ReactIs.isValidElementType(ForwardRefComponent); // true
ReactIs.isValidElementType(Context.Provider); // true
ReactIs.isValidElementType(Context.Consumer); // true
```

### Determining an Element's Type

#### Context

```js
import React from "react";
import * as ReactIs from 'react-is';

const ThemeContext = React.createContext("blue");

ReactIs.isContextConsumer(<ThemeContext.Consumer />); // true
ReactIs.isContextProvider(<ThemeContext.Provider />); // true
ReactIs.typeOf(<ThemeContext.Provider />) === ReactIs.ContextProvider; // true
ReactIs.typeOf(<ThemeContext.Consumer />) === ReactIs.ContextConsumer; // true
```

#### Element

```js
import React from "react";
import * as ReactIs from 'react-is';

ReactIs.isElement(<div />); // true
ReactIs.typeOf(<div />) === ReactIs.Element; // true
```

#### Fragment

```js
import React from "react";
import * as ReactIs from 'react-is';

ReactIs.isFragment(<></>); // true
ReactIs.typeOf(<></>) === ReactIs.Fragment; // true
```

#### Portal

```js
import React from "react";
import ReactDOM from "react-dom";
import * as ReactIs from 'react-is';

const div = document.createElement("div");
const portal = ReactDOM.createPortal(<div />, div);

ReactIs.isPortal(portal); // true
ReactIs.typeOf(portal) === ReactIs.Portal; // true
```

#### StrictMode

```js
import React from "react";
import * as ReactIs from 'react-is';

ReactIs.isStrictMode(<React.StrictMode />); // true
ReactIs.typeOf(<React.StrictMode />) === ReactIs.StrictMode; // true
```

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