/ live.thehmm.nl / back / node_modules / prop-types-exact /

[ICO]NameLast modifiedSizeDescription
[PARENTDIR]Parent Directory  -  
[DIR]build/2 years ago -  
[DIR]src/2 years ago -  
[DIR]test/2 years ago -  
[TXT]CHANGELOG.md40 years ago1.5K 
[   ]LICENSE40 years ago1.0K 
[TXT]README.md40 years ago1.6Kd7c1522 post receive test [كارل مبارك]
[TXT]install-relevant-react.sh40 years ago282  
[   ]package.json2 years ago3.5K 
README.md

prop-types-exact Version Badge

Build Status dependency status dev dependency status 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

Apache/2.4.38 (Debian) Server at www.karls.computer Port 80