Loading [MathJax]/jax/output/HTML-CSS/fonts/TeX/fontdata.js

Using Prop Types within a component

Then in order to use it, you select the component and you set it's props to the type you want them to have. The types can be string, bool, object, number etc. Additionally you can specify if a property will be mandatory on instantiation of the component or not (required or optional) as it is shown above. ​​​

By taking a look at our example above with the heading, the prop paragraphText not only must be there, anytime we create a MyHeading instance, but also must be of a type string. 

The propTypes object, when attached to a component, contains the component's props as keys, and a number of pre-defined requirements as values.