From 4d1197b3be54da0eebbfce0b7a3e5a1c0442ff02 Mon Sep 17 00:00:00 2001 From: Vlad Date: Sat, 29 Jun 2019 21:05:42 +0300 Subject: [PATCH] Add description of PropTypes.exact (#1581) Info from https://github.com/facebook/prop-types#usage --- content/docs/typechecking-with-proptypes.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/content/docs/typechecking-with-proptypes.md b/content/docs/typechecking-with-proptypes.md index 4004e7820..c986fc010 100644 --- a/content/docs/typechecking-with-proptypes.md +++ b/content/docs/typechecking-with-proptypes.md @@ -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.