Remove PropTypes dependency from ReactLink (#9766)

It doesn't seem to be used. It was probably used by internal FB consumers of ReactLink which has long been removed.
This commit is contained in:
Dan Abramov
2017-05-26 23:21:50 +01:00
committed by GitHub
parent 6086a22482
commit b34a312e6c
-23
View File
@@ -34,7 +34,6 @@
* consumption of ReactLink easier; see LinkedValueUtils and LinkedStateMixin.
*/
var PropTypes = require('prop-types');
var React = require('React');
/**
@@ -49,26 +48,4 @@ function ReactLink(value, requestChange) {
this.requestChange = requestChange;
}
/**
* Creates a PropType that enforces the ReactLink API and optionally checks the
* type of the value being passed inside the link. Example:
*
* MyComponent.propTypes = {
* tabIndexLink: ReactLink.PropTypes.link(React.PropTypes.number)
* }
*/
function createLinkTypeChecker(linkType) {
var shapes = {
value: linkType === undefined
? PropTypes.any.isRequired
: linkType.isRequired,
requestChange: PropTypes.func.isRequired,
};
return PropTypes.shape(shapes);
}
ReactLink.PropTypes = {
link: createLinkTypeChecker,
};
module.exports = ReactLink;