@zitterorg/maxime-dolor
v3.7.62
Published
[![github actions][actions-image]][actions-url] [![coverage][codecov-image]][codecov-url] [![License][license-image]][license-url] [![Downloads][downloads-image]][downloads-url]
Downloads
349
Maintainers
Keywords
Readme
@zitterorg/maxime-dolor ![Version Badge](http://versionbadg.es/ljharb/@zitterorg/maxime-dolor.svg)
For use with React PropTypes. Will error on any prop not explicitly specified.
Usage
import PropTypes from 'prop-types';
import exact from '@zitterorg/maxime-dolor';
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