# element-prop-types

> React PropType for props-elements

Latest version **1.0.3** (published 2018-03-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install element-prop-types
pnpm add element-prop-types
yarn add element-prop-types
bun add element-prop-types
```

## Health

**Score 25/100 (F)** — status: abandoned.

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

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2018-03-13 |
| First published | 2017-11-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 3.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Ardalan Amini |
| Maintainers | ardalanamini |
| Keywords | react, prop, prop-type, proptype, element |

## Links

- npm: https://www.npmjs.com/package/element-prop-types
- Repository: https://github.com/ardalanamini/element-prop-types
- Homepage: https://github.com/ardalanamini/element-prop-types#readme
- Issues: https://github.com/ardalanamini/element-prop-types/issues
- npm.io page: https://npm.io/package/element-prop-types

## Dependencies (4)

- [react](https://npm.io/package/react.md) ^16.2.0
- [prop-types](https://npm.io/package/prop-types.md) ^15.6.1
- [@types/react](https://npm.io/package/@types/react.md) ^16.0.40
- [@types/prop-types](https://npm.io/package/@types/prop-types.md) ^15.5.2

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

- 1.0.3 (latest) — 2018-03-13
- 1.0.2 — 2018-03-13
- 1.0.1 — 2017-11-19
- 1.0.0 — 2017-11-18

## README

# element-prop-types
React PropTypes for props-elements

[![npm](https://img.shields.io/npm/v/element-prop-types.svg)](https://www.npmjs.com/package/element-prop-types)
[![npm](https://img.shields.io/npm/dt/element-prop-types.svg)](https://www.npmjs.com/package/element-prop-types)
[![GitHub license](https://img.shields.io/github/license/ardalanamini/element-prop-types.svg)](https://github.com/ardalanamini/element-prop-types/blob/master/LICENSE)

## Install

```
npm install --save element-prop-types
```

## Usage

```js
const ElementPropTypes = require('element-prop-types');

const Modal = ({ header, items }) => (
    <div>
        <div>{header}</div>
        <div>{items}</div>
    </div>
);

Modal.propTypes = {
    header: ElementPropTypes.elementOf(Header).isRequired,
    items: PropTypes.arrayOf(ElementPropTypes.elementOf(Item))
};

// render Modal
React.render(
    <Modal
       header={<Header title="This is modal" />}
       items={[
           <Item/>,
           <Item/>,
           <Item/>
       ]}
    />,
    rootElement
);
```

## API

### `elementOf(Component)`

checks the type of a React element

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