Include the prop-types
package:
npm install --save prop-types
In code on the class file, add (outside the class, but before the export default
):
<class_name>.propTypes = {
<prop_name>: PropTypes.string.isRequired // Example
};
Posted by hashharvest to ReactJS (2018-05-02 03:44)