JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1216523
  • Score
    100M100P100Q206184F
  • License MIT

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

Package Exports

  • prop-types-exact
  • prop-types-exact/build/helpers/isPlainObject
  • prop-types-exact/build/helpers/isPlainObject.js
  • prop-types-exact/src/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (prop-types-exact) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

prop-types-exact Version Badge

github actions coverage License Downloads

npm badge

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

Usage

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