Skip to content

Commit dc650ec

Browse files
lonyelelex111
authored andcommitted
Update docs about an existence of .elementType (#2145)
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.
1 parent b84fb3d commit dc650ec

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

content/docs/typechecking-with-proptypes.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ MyComponent.propTypes = {
5757
// A React element.
5858
optionalElement: PropTypes.element,
5959

60+
// A React element type (ie. MyComponent).
61+
optionalElementType: PropTypes.elementType,
62+
6063
// You can also declare that a prop is an instance of a class. This uses
6164
// JS's instanceof operator.
6265
optionalMessage: PropTypes.instanceOf(Message),

0 commit comments

Comments
 (0)