Browse Source

Update docs about an existence of .elementType (#2145)

Hi, I've met the same issue on [here](https://github.com/facebook/prop-types/issues/200) at storybook and found the following [PR](https://github.com/facebook/prop-types/pull/211) that adds the `elementType` feature. It could find the doc on npm, but not the official react site.
main
Taeheon Kim 6 years ago
committed by Alexey Pyltsyn
parent
commit
dc650ecdae
  1. 3
      content/docs/typechecking-with-proptypes.md

3
content/docs/typechecking-with-proptypes.md

@ -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),

Loading…
Cancel
Save