# prop-types-exact

> For use with React PropTypes. Will error on any prop not explicitly specified.

Latest version **1.2.7** (published 2024-12-29) · MIT license · 0 weekly downloads

## Install

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

## Health

**Score 25/100 (F)** — status: maintenance-mode.

Positive: no vulnerabilities.

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

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.7 |
| Published | 2024-12-29 |
| First published | 2017-06-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 0.8 |
| Dependencies | 6 |
| Unpacked size | 22.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Jordan Harband |
| Maintainers | lencioni, ljharb |
| Keywords | react, propTypes, prop, types, validator, validation, exact |

## Links

- npm: https://www.npmjs.com/package/prop-types-exact
- Repository: https://github.com/ljharb/prop-types-exact
- Homepage: https://github.com/ljharb/prop-types-exact#readme
- Issues: https://github.com/ljharb/prop-types-exact/issues
- Funding: https://github.com/sponsors/ljharb
- npm.io page: https://npm.io/package/prop-types-exact

## Dependencies (6)

- [hasown](https://npm.io/package/hasown.md) ^2.0.2
- [isarray](https://npm.io/package/isarray.md) ^2.0.5
- [own-keys](https://npm.io/package/own-keys.md) ^1.0.0
- [es-errors](https://npm.io/package/es-errors.md) ^1.3.0
- [call-bound](https://npm.io/package/call-bound.md) ^1.0.3
- [object.assign](https://npm.io/package/object.assign.md) ^4.1.7

## 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.2.7 (latest) — 2024-12-29
- 1.2.6 — 2024-12-16
- 1.2.5 — 2024-07-11
- 1.2.4 — 2024-05-23
- 1.2.3 — 2024-05-23
- 1.2.2 — 2024-05-22
- 1.2.1 — 2024-05-22
- 1.2.0 — 2018-06-15
- 1.1.2 — 2018-01-17
- 1.1.1 — 2017-07-06
- 1.1.0 — 2017-06-05
- 1.0.0 — 2017-06-05

## README

# prop-types-exact <sup>[![Version Badge][npm-version-svg]][package-url]</sup>

[![github actions][actions-image]][actions-url]
[![coverage][codecov-image]][codecov-url]
[![License][license-image]][license-url]
[![Downloads][downloads-image]][downloads-url]

[![npm badge][npm-badge-png]][package-url]

For use with React PropTypes. Will error on any prop not explicitly specified.

## Usage

```jsx
import PropTypes from 'prop-types';
import exact from 'prop-types-exact';

function Foo({ foo, bar }) {
  return <div>{foo}{bar}</div>
}
Foo.propTypes = exact({
  foo: PropTypes.string,
  bar: PropTypes.number,
});

<Foo foo="hi" bar={3} /> // no warnings

<Foo foo="hi" bar={3} baz="extra" /> // propTypes warning!
```

## Tests
Simply clone the repo, `npm install`, and run `npm test`

[package-url]: https://npmjs.org/package/prop-types-exact
[npm-version-svg]: http://versionbadg.es/ljharb/prop-types-exact.svg
[deps-svg]: https://david-dm.org/ljharb/prop-types-exact.svg
[deps-url]: https://david-dm.org/ljharb/prop-types-exact
[dev-deps-svg]: https://david-dm.org/ljharb/prop-types-exact/dev-status.svg
[dev-deps-url]: https://david-dm.org/ljharb/prop-types-exact#info=devDependencies
[npm-badge-png]: https://nodei.co/npm/prop-types-exact.png?downloads=true&stars=true
[license-image]: http://img.shields.io/npm/l/prop-types-exact.svg
[license-url]: LICENSE
[downloads-image]: http://img.shields.io/npm/dm/prop-types-exact.svg
[downloads-url]: http://npm-stat.com/charts.html?package=prop-types-exact
[codecov-image]: https://codecov.io/gh/ljharb/prop-types-exact/branch/main/graphs/badge.svg
[codecov-url]: https://app.codecov.io/gh/ljharb/prop-types-exact/
[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/prop-types-exact
[actions-url]: https://github.com/ljharb/prop-types-exact/actions

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