Browse Source

Add PropTypes.ArrayOf and clean up ReactPropTypes.js

main
cpojer 11 years ago
parent
commit
5989a938d3
  1. 3
      docs/05-reusable-components.md

3
docs/05-reusable-components.md

@ -37,6 +37,9 @@ React.createClass({
// it as an enum.
optionalEnum: React.PropTypes.oneOf(['News','Photos']),
// Expect an array of a certain propType
optionalArrayOf: React.PropTypes.arrayOf(React.PropTypes.number)
// You can also declare that a prop is an instance of a class. This uses
// JS's instanceof operator.
someClass: React.PropTypes.instanceOf(SomeClass),

Loading…
Cancel
Save