Skip to content

Commit

Permalink
Update docs about an existence of .elementType
Browse files Browse the repository at this point in the history
Hi, I've met the same issue on [here](facebook/prop-types#200) at storybook and found the following [PR](facebook/prop-types#211) that adds the `elementType` feature. It could find the doc on npm, but not the official react site.
  • Loading branch information
lonyele committed Jul 13, 2019
1 parent 4af9f2d commit b63d27a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions content/docs/typechecking-with-proptypes.md
Expand Up @@ -57,6 +57,9 @@ MyComponent.propTypes = {
// A React element.
optionalElement: PropTypes.element,

// A React element type (ie. MyComponent).
optionalElementType: PropTypes.elementType,

// You can also declare that a prop is an instance of a class. This uses
// JS's instanceof operator.
optionalMessage: PropTypes.instanceOf(Message),
Expand Down

0 comments on commit b63d27a

Please sign in to comment.