1Component.propTypes = {
2
3 booleanObjectProp: PropTypes.objectOf(
4 PropTypes.bool
5 ),
6
7 multipleObjectProp: PropTypes.objectOf(
8 PropTypes.oneOfType([
9 PropType.func,
10 PropType.number,
11 PropType.string,
12 PropType.instanceOf(Person)
13 ])
14 )
15
16}
1Pokemon.propTypes = {
2 pokemon: PropTypes.shape({
3 name: PropTypes.string,
4 id: PropTypes.number,
5 base_stamina: PropTypes.number,
6 base_defense: PropTypes.number
7 })
8}
1// You can also declare that a prop is an instance of a class. This uses
2// JS's instanceof operator.
3optionalMessage: React.PropTypes.instanceOf(Message),