function createChainableTypeChecker(validate) {
  function checkType(isRequired, props, propName, componentName, location, propFullName) {
    componentName = componentName || ANONYMOUS;
    propFullName = propFullName || propName;
    if (props[propName] == null) {
      var locationName = ReactPropTypeLocationNames[location];
      if (isRequired) {
        return new Error('Required ' + locationName + ' `' + propFullName + '` was not specified in ' + ('`' + componentName + '`.'));
      }
      return null;
    } else {
      return validate(props, propName, componentName, location, propFullName);
    }
  }

  var chainedCheckType = checkType.bind(null, false);
  chainedCheckType.isRequired = checkType.bind(null, true);

  return chainedCheckType;
}
Collection of methods that allow declaration and validation of props that are
supplied to React components. Example usage:

  var Props = require('ReactPropTypes');
  var MyArticle = React.createClass({
    propTypes: {
      // An optional string prop named "description".
      description: Props.string,

      // A required enum prop named "category".
      category: Props.oneOf(['News','Photos']).isRequired,

      // A prop named "dialog" that requires an instance of Dialog.
      dialog: Props.instanceOf(Dialog).isRequired
    },
    render: function() { ... }
  });

A more formal specification of how these methods are used:

  type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
  decl := ReactPropTypes.{type}(.isRequired)?

Each and every declaration produces a function with the same signature. This
allows the creation of custom validation functions. For example:

 var MyLink = React.createClass({
   propTypes: {
     // An optional string or URI prop named "href".
     href: function(props, propName, componentName) {
       var propValue = props[propName];
       if (propValue != null && typeof propValue !== 'string' &&
           !(propValue instanceof URI)) {
         return new Error(
           'Expected a string or an URI for ' + propName + ' in ' +
           componentName
         );
       }
     }
   },
   render: function() {...}
 });

@internal