Add description of PropTypes.exact (#1581)

Info from https://github.com/facebook/prop-types#usage
This commit is contained in:
Vlad
2019-06-29 21:05:42 +03:00
committed by Alex Krolick
parent cb5a61cdbf
commit 4d1197b3be

View File

@@ -83,6 +83,12 @@ MyComponent.propTypes = {
color: PropTypes.string,
fontSize: PropTypes.number
}),
// An object with warnings on extra properties
optionalObjectWithStrictShape: PropTypes.exact({
name: PropTypes.string,
quantity: PropTypes.number
}),
// You can chain any of the above with `isRequired` to make sure a warning
// is shown if the prop isn't provided.