In the code editor, take a look at
MessageDisplayer's render function.
Notice the expression
this.props.message. From this expression, you can deduce that
MessageDisplayer expects to get passed a
message. Somewhere, at some time, this code is expected to execute:
<MessageDisplayer message="something" />
If a component class expects a
prop, then you can give that component class a
The first step to making a
propType is to search for a property named
propTypes on the instructions object. If there isn't one, make one! Put it at the top of the instructions object, so that it'll be easy to spot if you end up searching for it again.
See the example of a
propTypes property on lines 6-8. Notice that the value of
propTypes is an object, not a function!
The second step is to add a property to the
propTypes object. For each
prop that your component class expects to receive, there can be one property on your
MessageDisplayer only expects one
message. Therefore, its
propTypes object only has one property.