# react-extra-prop-types

> Extra PropTypes for use with React components

Latest version **0.3.1** (published 2017-07-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-extra-prop-types
pnpm add react-extra-prop-types
yarn add react-extra-prop-types
bun add react-extra-prop-types
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.1 |
| Published | 2017-07-17 |
| First published | 2016-12-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Ben Wiley |
| Maintainers | benwiley4000 |
| Keywords | react, props, proptypes, proptype, integer, int, color, hex, date, datetime, uuid, guid, extra |

## Links

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

## Alternatives

- [eslint-plugin-sonarjs](https://npm.io/package/eslint-plugin-sonarjs.md) — 2.9M weekly downloads
- [eslint-config-expo](https://npm.io/package/eslint-config-expo.md) — 1.5M weekly downloads
- [@matter/protocol](https://npm.io/package/@matter/protocol.md) — 63.5K weekly downloads
- [@eventcatalog/linter](https://npm.io/package/@eventcatalog/linter.md) — 24.8K weekly downloads
- [@inrupt/eslint-config-base](https://npm.io/package/@inrupt/eslint-config-base.md) — 4.5K weekly downloads

## Recent versions

- 0.3.1 (latest) — 2017-07-17
- 0.3.0 — 2016-12-09
- 0.2.0 — 2016-12-09
- 0.1.0 — 2016-12-08

## README

# react-extra-prop-types

Includes some additional React [PropTypes](https://facebook.github.io/react/docs/typechecking-with-proptypes.html) for common use cases. No dependencies.

[![NPM](https://nodei.co/npm/react-extra-prop-types.png)](https://npmjs.org/package/react-extra-prop-types)

## PropTypes

* `integer` - invalid if prop is non-integer
* `color` - invalid if prop is not valid [CSS color string](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value) (rgb(a), hsl(a), hex). Excludes keywords.
* `datetime` - invalid if prop is not string which can be passed to JavaScript [`Date`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) constructor with valid result
* `uuid` - invalid if prop is not valid [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier)

## Usage

### `require`-ing

```javascript
var ExtraPropTypes = require('react-extra-prop-types');
var color = ExtraPropTypes.color;
var uuid = ExtraPropTypes.uuid;

// or ...
var color = require('react-extra-prop-types/lib/color');
var uuid = require('react-extra-prop-types/lib/uuid');
```

### use just like normal `PropTypes`

```javascript
MyReactComponent.propTypes = {
  id: ExtraPropTypes.integer,
  name: React.PropTypes.string,
  lastFetchTime: ExtraPropTypes.datetime
};
```

### props are optional unless `.isRequired` is used

```javascript
MyReactComponent.propTypes = {
  id: ExtraPropTypes.integer.isRequired // can't be left out
};
```

## Development

See [CONTRIBUTING.md](CONTRIBUTING.md).

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