Question
In the context of this exercise, what other propType data types are there?
Answer
For most, if not all, data types in JavaScript, that data type can be used as a propType. The most common ones are as follows,
PropTypes.array
PropTypes.bool
PropTypes.func
PropTypes.number
PropTypes.object
PropTypes.string
PropTypes.symbol
In addition to these, there are several other types that you can use to check the values of props as well.
// A React element
PropTypes.element
// Instance of a specific class
PropTypes.instanceOf(ClassName)
// Array of a specified type
PropTypes.arrayOf(PropTypes.number)
// Object with property values that are a specific value
PropTypes.objectOf(PropTypes.string)