Setting up PropTypes

Posted Almost 6 years ago. Visible to the public. Draft.

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
Posted by hashharvest to ReactJS (2018-05-02 03:44)