mirror of
https://github.com/reactjs/react.dev.git
synced 2026-02-24 04:33:10 +00:00
Add description of PropTypes.exact (#1581)
Info from https://github.com/facebook/prop-types#usage
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user