Setting up PropTypes

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
};
hashharvest About 6 years ago