prop-types-exact

WebJar for prop-types-exact

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

prop-types-exact
Last Version

Last Version

1.2.0
Release Date

Release Date

Type

Type

jar
Description

Description

prop-types-exact
WebJar for prop-types-exact
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/airbnb/prop-types-exact

Download prop-types-exact

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/prop-types-exact/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>prop-types-exact</artifactId>
    <version>1.2.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/prop-types-exact/
implementation 'org.webjars.npm:prop-types-exact:1.2.0'
// https://jarcasting.com/artifacts/org.webjars.npm/prop-types-exact/
implementation ("org.webjars.npm:prop-types-exact:1.2.0")
'org.webjars.npm:prop-types-exact:jar:1.2.0'
<dependency org="org.webjars.npm" name="prop-types-exact" rev="1.2.0">
  <artifact name="prop-types-exact" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='prop-types-exact', version='1.2.0')
)
libraryDependencies += "org.webjars.npm" % "prop-types-exact" % "1.2.0"
[org.webjars.npm/prop-types-exact "1.2.0"]

Dependencies

compile (3)

Group / Artifact Type Version
org.webjars.npm : has jar [1.0.3,2)
org.webjars.npm : object.assign jar [4.1.0,5)
org.webjars.npm : reflect.ownkeys jar [0.2.0,0.3)

Project Modules

There are no modules declared in this project.

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

org.webjars.npm

Airbnb

Versions

Version
1.2.0