proptypes
React's PropTypes, packaged up as a standalone module.
DISCLAIMER: This is literally copied from the React 0.14 codebase. If you're using PropTypes with React, it would be silly to reference this standalone version.
Usage
{ for let prop in propTypes if propTypes let err = propTypespropprops prop 'name' 'prop'; if err console; return false; return true;} let valid = ; valid; // true
Production build
Disabling
With webpack:
moduleexports = resolve: alias: proptypes: 'proptypes/disabled' ;
Removing the definitions with React
When you are using this package with React like API, you might want to save bandwidth by removing the definitions. You can use babel-plugin-transform-react-remove-prop-types for that use case, for instance:
// Inconst Baz = <div ...props />; BazpropTypes = className: PropTypesstring; // Outconst Baz = <div ...props />;
License
BSD